Off - Work in progress

This commit is contained in:
claudio 2015-06-09 15:51:28 -04:00
parent 825660b2d8
commit cf0ae2c47f
3 changed files with 38 additions and 0 deletions

View file

@ -1194,6 +1194,17 @@ void shiftedalphaKeyHandler(BINT keymsg)
}
void offKeyHandler(BINT keymsg)
{
// GET EVERYTHING READY FOR A WARM-RESTART
cpu_off();
// DOES NOT RETURN
}
#define DECLARE_KEYHANDLER(name,lsymbol,csymbol) void name##KeyHandler(BINT keymsg) \
{ \
alphasymbolKeyHandler(keymsg,(BYTEPTR)(lsymbol),(BYTEPTR)(csymbol)); \

View file

@ -223,3 +223,25 @@ void cpu_flushTLB(void)
asm volatile ("mcr p15, 0, %0, c8, c7, 0" : : "r" (value));
}
void cpu_off()
{
// TODO: CHECK FOR SERIAL TRANSMISSIONS, SD CARD WRITE OPERATIONS, ETC BEFORE GOING DOWN
// MASK ALL INTERRUPTS
__cpu_intoff();
// SETUP ON KEY TO WAKE UP
// SETUP ALARM TO WAKE UP
// SAVE SOMETHING IN RSTATUS3 AND 4
// GO OFF!
}

View file

@ -89,3 +89,8 @@ void cpu_flushTLB(void)
{
// DUMMY
}
void cpu_off()
{
// DUMMY
}