Can anyone explain or duplicate this error
bambino
Posts: 789
·[noparse][[/noparse]code "test debug"
obj
·· com : "SimpleDebug"
·· pad : "Keyboard"
Var
·· long stack[noparse][[/noparse]9]
·· byte thing
·· byte cog
pub Main
·· cog := (cognew(com.start(115200),@stack)+1)
·· pad.start(27,26)
·· repeat
···· thing := new.key
···· com.putc(thing)
···· waitcnt(25_000+cnt)
···outa[noparse][[/noparse]16]
/code]
This code (done from memory,may not be exactly what I got at home) works,
but when I take out the line outa[noparse][[/noparse]16] I get nothing when I run the program.
This isn't how I intend to use the routine, I actually have it working without the outa in a subroutine instead of main. I am just curious why the loop will not execute without the outa statement doing nothing here, when it seems like it would never get called anyway.
obj
·· com : "SimpleDebug"
·· pad : "Keyboard"
Var
·· long stack[noparse][[/noparse]9]
·· byte thing
·· byte cog
pub Main
·· cog := (cognew(com.start(115200),@stack)+1)
·· pad.start(27,26)
·· repeat
···· thing := new.key
···· com.putc(thing)
···· waitcnt(25_000+cnt)
···outa[noparse][[/noparse]16]
/code]
This code (done from memory,may not be exactly what I got at home) works,
but when I take out the line outa[noparse][[/noparse]16] I get nothing when I run the program.
This isn't how I intend to use the routine, I actually have it working without the outa in a subroutine instead of main. I am just curious why the loop will not execute without the outa statement doing nothing here, when it seems like it would never get called anyway.
Comments
As you rightly say it should never run the outa line. I wonder if the problem is the waitcnt, this is the only command that could go wrong if the time was too short. I wonder if increasing the delay would change anything. Grasping at straws, most confusing.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Sorry about the delay(no internet at home).
I will try that when I get home out of curiosity, as I stated before when I put the routine in a sub routine it worked fine.(Then I found the monitor object last night and I had to slap myself for recreating the wheel here).