Shop OBEX P1 Docs P2 Docs Learn Events
Debug examples won't complie — Parallax Forums

Debug examples won't complie

I thought I would try out the new fancy debug stuff in the PropTool, but none of the examples from The Manual will compile. I am running Proptool 2.6.2

There appears to be a backtick ` in the code. I don't know why it is there. Feeling really dumb right now, because there are so many nice tools available, and I can't figure them out.

Thanks in advance!
--Terry

Comments

  • ColeyColey Posts: 1,108

    Works fine here, V2.6.2

  • Do you just press F10?

  • @ke4pjw said:
    I thought I would try out the new fancy debug stuff in the PropTool, but none of the examples from The Manual will compile. I am running Proptool 2.6.2

    There appears to be a backtick ` in the code. I don't know why it is there. Feeling really dumb right now, because there are so many nice tools available, and I can't figure them out.

    Thanks in advance!
    --Terry

    Proptool defaults to the Spin1 (P1) language. Depending on how you entered/loaded your P2 code, it is probably being interpreted as P1 Spin.

    Spin1 doesn't recognize the backtick character as part of the language syntax.

    Make sure the Demo code that you are working with has been saved/marked as P2 Spin2 code, in other words make sure the filename has been saved with a .spin2 file extension.

  • @"Francis Bauer" said:

    @ke4pjw said:
    I thought I would try out the new fancy debug stuff in the PropTool, but none of the examples from The Manual will compile. I am running Proptool 2.6.2

    There appears to be a backtick ` in the code. I don't know why it is there. Feeling really dumb right now, because there are so many nice tools available, and I can't figure them out.

    Thanks in advance!
    --Terry

    Proptool defaults to the Spin1 (P1) language. Depending on how you entered/loaded your P2 code, it is probably being interpreted as P1 Spin.

    Spin1 doesn't recognize the backtick character as part of the language syntax.

    Make sure the Demo code that you are working with has been saved/marked as P2 Spin2 code, in other words make sure the filename has been saved with a .spin2 file extension.

    I bet this is it. I didn't save it, so the default must be spin1.

  • It should probably be changed to have a toggle for P1/P2 mode rather than detecting from file type. I don't think having both connected and alternating uploads between them is a common enough use case. And for that, it can still be a CTRL+Something, I guess.

  • evanhevanh Posts: 15,187

    @ke4pjw said:
    I bet this is it. I didn't save it, so the default must be spin1.

    If the filename ends with .spin then that's assumed to be a Spin1 program. Just have to look at the filename.

  • That was it. It wasn't saved. File->New defaults to spin 1. Once saved as a .spin2 file, it would compile.

    It has been almost two years since I last played with the P2 and so much has changed. Proptool is now available, etc. My skills are so rusty :(

  • evanhevanh Posts: 15,187
    edited 2022-01-10 01:45

    Oh, it wasn't loaded from a file. I hadn't thought of that case either.

    That's new territory for PropTool. I guess a new option selector is indeed called for.

  • @ke4pjw The back ticks are important. It's sort of a hint to the compiler that debug syntax is coming. In the propeller tool under the "Run" menu make sure "Debug is enabled" (Ctrl+D) this tells the compiler to include the debug code. Yeah, I hate when I choose "New (From P2 Template" in the File Menu it doesn't automatically setup to save to a .spin2 file. I've been bit by this several times.

  • @ke4pjw Here's some debug code for you to play with. Some of my early work.
    https://forums.parallax.com/discussion/173300/my-orion-command-and-monitor-display-project-using-debug

  • Why not let it test which Propeller is connected, before download.

  • VonSzarvasVonSzarvas Posts: 3,278
    edited 2022-01-12 12:42

    Another way might be to check for brackets on the first method call. I don't recall any use cases that include parameters in the first function of P1/SPIN code, so this could work...:

    pub go   ' I'm  spin1 - use Propeller 1 download protocol
    
    pub go()   ' I'm  spin2 - use Propeller 2 download protocol
    
  • Yes but you can't download anyway without a Propeller.

  • VonSzarvasVonSzarvas Posts: 3,278
    edited 2022-01-12 14:47

    True, but the issue impacts compiling too-- the Propeller might not be connected at that stage.

    Would be neat if the tool could put itself into the right mode, either automatically or with something like the Stamp-esque define block that Jon suggested.

    ps. Apologies ke4pjw for drifting OT :)

Sign In or Register to comment.