Skip to content

Commit

Permalink
Merge pull request #29 from toniebox-reverse-engineering/develop
Browse files Browse the repository at this point in the history
Nightly 20220501
  • Loading branch information
SciLor authored May 1, 2022
2 parents e82aa81 + 4e35fa4 commit d904137
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BoxPower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ void BoxPower::_preparePowerDown() {
Log.info("Prepare power down...");
//TODO
//smartconfig down
Box.watchdog_stop();
Box.logStreamMulti.flush();
Box.boxPlayer.stop();
setSdPower(false);
setOtherPower(false);
Box.boxLEDs.setAllBool(false);
Serial.end();
Box.watchdog_stop();
}
void BoxPower::reset() {
Events.handlePowerEvent(PowerEvent::PRE_RESET);
Expand Down
15 changes: 15 additions & 0 deletions Hackiebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ BoxConfig Config;
BoxEvents Events;
Hackiebox Box;


void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *pSlDeviceEvent) {
Log.error("Received _SlDrvHandleGeneralEvents Event=%i", pSlDeviceEvent->Event);
}
int Report(const char *format, ...) {
//Workaround for defined Report in the WiFi/utility/
va_list args;
va_start(args, format);
Log.printFormat(format, args);
return 0;
}
void crash(crashSource source, uint32_t* sp) {
//Box.logStreamSse.setSsePaused(true);
Log.info("crashSource=%i, sp=%X, sp=%X", source, sp, (uint32_t)sp-0x20004000);
Expand All @@ -30,6 +41,10 @@ void crash(crashSource source, uint32_t* sp) {
_file.close();
}
Log.info("...done");

__asm__ volatile("bkpt");

Box.boxPower.hibernate();
}
void Hackiebox::setup() {
if (!watchdog_start()) {
Expand Down

0 comments on commit d904137

Please sign in to comment.