then 'Yes'. But that's being pedantic.
You can do the EI at the very end of your ISR to re-enable the next interrupt. Most people write like this.
(If you do HALT with interrupts disabled then you lock up the machine!)
So if your ISR always does EI then RET at the end, then the answer is 'Yes'. You can just use HALT whenever you like.
Some people though simply have the ISR do a RET and nothing else. It exists solely for timing. This is for people writing games where their whole code timing is super-critical. Therefore you have to do EI before HALT when you want it to happen.
Joefish wrote: ↑Wed Jun 13, 2018 11:39 am
So if your ISR always does EI then RET at the end, then the answer is 'Yes'. You can just use HALT whenever you like.
Yes, the ISR re-enables the interrupt when it exits. So, all good, thanks.