#177133 - sverx - Fri Dec 16, 2011 11:10 am
I'm not really sure I understood completely how to work with interrupts :|
I have an ARM7 code where I'm managing interrupts with many handlers: VBlank, VCount, Timer0, wi-fi... then, in the VBlank handler, I have to call some PowerManagement functions, but I read that it is unsafe to leave interrupts enabled while doing that...
So first I disabled the interrupts:
do the PowerManagement function calls, and re-enable the interrupts:
well, sometimes it happens that after doing that, the ARM7 stops managing the interrupts: for instance I'm sure that the Timer0 interrupt handler doesn't get called because it is the music timer, and I hear that the music get stuck.
Any suggestions? What does happen to the interrupts that happen when IME is disabled? Do they get queued or what?
Thanks!
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary
I have an ARM7 code where I'm managing interrupts with many handlers: VBlank, VCount, Timer0, wi-fi... then, in the VBlank handler, I have to call some PowerManagement functions, but I read that it is unsafe to leave interrupts enabled while doing that...
So first I disabled the interrupts:
Code: |
REG_IME = IME_DISABLE; |
do the PowerManagement function calls, and re-enable the interrupts:
Code: |
REG_IME = IME_ENABLE; |
well, sometimes it happens that after doing that, the ARM7 stops managing the interrupts: for instance I'm sure that the Timer0 interrupt handler doesn't get called because it is the music timer, and I hear that the music get stuck.
Any suggestions? What does happen to the interrupts that happen when IME is disabled? Do they get queued or what?
Thanks!
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary