Shop OBEX P1 Docs P2 Docs Learn Events
Long, must have but not used — Parallax Forums

Long, must have but not used

Matthew JonesMatthew Jones Posts: 14
edited 2012-05-09 20:07 in Propeller 1
I have funny thing happening I do not understand. I wrote a small file to display a timer in the serial terminal. I was having alot of problems getting the function to pass the data back out and display it. I kept getting byte symbols or whatever you call them.

Anyway I tried different stuff and it finally worked until I went to clean up the code. I erased a long that was in there but not being used and the serial terminal started spitting out jumble again and beeping. But if the long is in it it works.

Can someone have a look or tell me if this is a known thing.

In addition I use FullDuplexSerialPlus. You'll see the long in the top of the file.

Thanks
Matt

CLOCK.ZIP

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2012-05-09 18:10
    Your problem is a different one. cognew (starting a SPIN method) requires a stack as the second parameter (@Time). Unfortunatly you only reserve a single long for it which means the following longs get used as well (memory corruption). Just modify your VAR section to look like this:
    VAR
      Long Time[32]
      Long Tenth
      ...
    
    and remove the useless entry. I am aware that 32 is overkill for this particular method but this should get you past the issue.
  • Matthew JonesMatthew Jones Posts: 14
    edited 2012-05-09 20:07
    Oh I see, I didn't give it enough. That makes sense.

    Thanks alot
    Matt
Sign In or Register to comment.