I may be on the wrong track, but here goes...
I suspect but cannot yet prove that in 1.3 the
waitforinterrupt(zxPinRisingEdge, 0) in task A, and the
waitforinterrupt(zxPinRisingEdge, 1) in task B,
conflict within the 1.3 VM.
As I flip between VM versions, and I do not re-download my application code, I get correct operation in 1.2.0 but not 1.3. I also tried re-downloading my code after switching VM versions - no affect.
The symptoms using 1.3 are as if the INT1 routine is not being called after a few seconds. It starts out correctly. I put in a debug.print for each interrupt task and this (as Murphy says) causes the bug to go away (but the screen is flooded with printouts).
If I omit launching either task, the other works correctly. Each task has its own stack, of course. I've tried it with one reentrant sub() and with two non-reentrant subs without any locals.
I hope this is not cockpit trouble on my part; I tried to preclude this before posting.
Any ideas?
(PS: was there a 1.2.2 version? I didn't find old versions on the web site).
Here's the code as modified from the reentrant version (commented out) to be the non-reentrant version where I use two separate sub()'s for the two tasks. The INT1 code is the same, with WaitInt1 used.
Reentrant or not, the problem persists only in VM 1.3.
Note that each task accesses the same global variable array, but using index 0 for one task and index 1 for the other. The main() task also accesses this array (reading).
Code: Select all
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' INTERRUPT PROCESSOR
''' Task to catch interrupts INT0 and INT1, these being the IR sensor receiver pulses
''' NOTE: There are two instances of this task, one per sensor
sub IRpulses_Task()
dim num as byte
'''num = IntNum ' INT0 vs. INT1 is passed in this global set before CallTask()
''' Loop forever
do
call waitForInterrupt(zxPinRisingEdge, WaitInt0) ' wait for next pulse from IR sensor
BeamIntCount(0) = BeamIntCount(0) + 1 ' Count pulses received since tick time was zero'd
'''debug.print cstr(num);
loop
end sub