COGNEW brings things to a halt
Hugh
Posts: 362
in Propeller 1
Hi,
I might be being thick here but please could I have some pointers (excuse the pun) to where I might be going wrong?
I have created some stackspace in the VAR section
Long stackOB[10]
and written a pub:
PUB OB | arepeat a := a
In the main PUB I have included
r := cognew(OB, @stackOB)lcd.dec(r)
but it doesn't get past the cognew statement; comment it out and it runs perfectly (showing 0 on the LCD).
What have I done that I shouldn't, or haven't done that I should've? It's probably obvious but I have been staring at it so long I can't see the wood for the trees.
Thanks in advance,
Hugh
I might be being thick here but please could I have some pointers (excuse the pun) to where I might be going wrong?
I have created some stackspace in the VAR section
Long stackOB[10]
and written a pub:
PUB OB | arepeat a := a
In the main PUB I have included
r := cognew(OB, @stackOB)lcd.dec(r)
but it doesn't get past the cognew statement; comment it out and it runs perfectly (showing 0 on the LCD).
What have I done that I shouldn't, or haven't done that I should've? It's probably obvious but I have been staring at it so long I can't see the wood for the trees.
Thanks in advance,
Hugh
Comments
Increasing the stack size to 35 longs didn't help. It is doing quite a few other things at the same time but disabling these made no difference - even the Cognew returning '0' would be useful.
The archived project is attached - I can only comment "you did ask!". Its not pretty, concise or well-commented...
It is polling a serial interface with an ELM327 chip to get values of engine data from the ECU on my car. Gathering the engine data works, gathering accelerometer data works, gathering GPS data works, writing all that data to an SD card works. Uncommenting that cognew brings it to a halt.