I'm wanting to have the option of changing the mask for a SETINT command depending on a test of variables but I keep getting a syntax error. I'm using a 28X2 on the AXE201. PE 6.1.0.0, compiler v.3.4.
In the main body of the code I use:
main:
setint OR %00000011, %00000011 to independently monitor two inputs, and in the interrupt: subroutine I then use:
interrupt:
sens7=pinC.0
sens8=pinC.1
if sens7wkg=0 then : sens7wkg=sens7 : endif
if sens8wkg=0 then : sens8wkg=sens8 : endif
if sens8wkg=1 then : setint %00000001, %00000001 : endif
which will be pointed back to main: after the return command (and the above SETINT command) and the syntax is happy despite a difference in the active commands in the interrupt: and main: routines.
However - if I want to put differing SETINT masks within IF...THEN commands so that if one variable has gone 'active' I can still monitor the other port while its variable is 'inactive' and ignore the still 'active' port, I get the syntax error:
if sens8wkg=1 then : setint %00000001, %00000001 : endif - this and the next line should monitor one port or the other depending on its specific variable
if sens7wkg=1 then : setint %00000010 %00000010 : endif
if sens7wkg=0 and sens8wkg=0 then : setint OR %00000011 %00000011 : endif - which monitors both ports (effectively the same as the command after main: )
Even if I put the three IF...THEN commands after main: (in place of the original command and not in the interrupt: routine) I still get the syntax error on them.
If only one SETINT command can be active depending on the variables sens8wkg and sens7wkg why does it not allow the above section of the interrupt: (or main: ) routine and yet accept differing SETINT commands as described earlier?
Baffled! What am I doing wrong, or misunderstanding?
In the main body of the code I use:
main:
setint OR %00000011, %00000011 to independently monitor two inputs, and in the interrupt: subroutine I then use:
interrupt:
sens7=pinC.0
sens8=pinC.1
if sens7wkg=0 then : sens7wkg=sens7 : endif
if sens8wkg=0 then : sens8wkg=sens8 : endif
if sens8wkg=1 then : setint %00000001, %00000001 : endif
which will be pointed back to main: after the return command (and the above SETINT command) and the syntax is happy despite a difference in the active commands in the interrupt: and main: routines.
However - if I want to put differing SETINT masks within IF...THEN commands so that if one variable has gone 'active' I can still monitor the other port while its variable is 'inactive' and ignore the still 'active' port, I get the syntax error:
if sens8wkg=1 then : setint %00000001, %00000001 : endif - this and the next line should monitor one port or the other depending on its specific variable
if sens7wkg=1 then : setint %00000010 %00000010 : endif
if sens7wkg=0 and sens8wkg=0 then : setint OR %00000011 %00000011 : endif - which monitors both ports (effectively the same as the command after main: )
Even if I put the three IF...THEN commands after main: (in place of the original command and not in the interrupt: routine) I still get the syntax error on them.
If only one SETINT command can be active depending on the variables sens8wkg and sens7wkg why does it not allow the above section of the interrupt: (or main: ) routine and yet accept differing SETINT commands as described earlier?
Baffled! What am I doing wrong, or misunderstanding?