I am developing a device that incorporates a clock (an MSF device that operates through an 08M2) and other functions. The clock updates each minute, using an interrupt to the main controller (14M2) before sending the new time data which the 14M2 forwards to the display.
Meanwhile, other functions are activated by interrrupts too. Is it permissible to re-enable the clock interrupt while another interrupt is being processed? In particular, will a new clock interrupt get handled correctly while a non-clock interrupt hasn't finished?
This is an outline of the code I'm thinking of, which compiles OK:
Meanwhile, other functions are activated by interrrupts too. Is it permissible to re-enable the clock interrupt while another interrupt is being processed? In particular, will a new clock interrupt get handled correctly while a non-clock interrupt hasn't finished?
This is an outline of the code I'm thinking of, which compiles OK:
Code:
#PICAXE 14M2
SYMBOL intrp = %00000011 ' Interrupt flag/mask using C.1 (mode switch) or C.0 (clock in)
SYMBOL intrc = %00000001 ' Interrupt flag/mask using C.0 (clock in) only
'.....
INTERRUPT: ' Interrupt on Mode switch OR Clock
IF PinC.0=1 THEN
GOSUB Clockout
ELSE
SETINT intrc, intrc 'Allow Clock interrupts only
GOSUB settings 'Deal with Mode switch
ENDIF
SETINT OR intrp,intrp 'Reset all interupts
RETURN