void main() { while(1){ P0 = 0xff; if(getResetMode() == 0x10) {//如果上电复位就直接进入掉电模式 clearReset(); //记得清零标识位 P0 &= 0xfe; enterPowerDown(); P0 &= 0x00; } else P0 &= 0xfb; while(1); } }
void Hacklace_AppEngine::run() { Hacklace::run(); if (app) { app->run(); } if (button == BTN1_RELEASED) { // switch to next app buttonAck(); nextApp(); } if (button == BTN1_LONGPRESSED) { // turn Hacklace off buttonAck(); enterPowerDown(); } }