Heckler
- 17th February 2016, 03:55
Hey Group,
I am writing some code that depends on interrupts for keeping time.
I am a bit confused in understanding where and how often I need to place the ENABLE and DISABLE INTERRUPT directive.
So if I have, say, several subroutines in my code and want to have INTERRUPTS ENABLED in each and all of them (or most of them) then do I need to place an ENABLE / DISABLE before and after each of the subroutines even if they are placed in my code IDE one after another? Or do I just need to ENABLE the whole block of subroutines? and then place a DISABLE at the end of the block?
for example...
ENABLE INTERRUPT
Sub1:
do some stuff
RETURN
'===========
Sub2:
do some other stuff
RETURN
DISABLE INTERRUPT
or do I need to do this...
ENABLE INTERRUPT
Sub1:
do some stuff
RETURN
DISABLE INTERRUPT
'===========
ENABLE INTERRUPT
Sub2:
do some other stuff
RETURN
DISABLE INTERRUPT
thanks in advance
I am writing some code that depends on interrupts for keeping time.
I am a bit confused in understanding where and how often I need to place the ENABLE and DISABLE INTERRUPT directive.
So if I have, say, several subroutines in my code and want to have INTERRUPTS ENABLED in each and all of them (or most of them) then do I need to place an ENABLE / DISABLE before and after each of the subroutines even if they are placed in my code IDE one after another? Or do I just need to ENABLE the whole block of subroutines? and then place a DISABLE at the end of the block?
for example...
ENABLE INTERRUPT
Sub1:
do some stuff
RETURN
'===========
Sub2:
do some other stuff
RETURN
DISABLE INTERRUPT
or do I need to do this...
ENABLE INTERRUPT
Sub1:
do some stuff
RETURN
DISABLE INTERRUPT
'===========
ENABLE INTERRUPT
Sub2:
do some other stuff
RETURN
DISABLE INTERRUPT
thanks in advance