Skip to content

Commit d904137

Browse files
authored
Merge pull request #29 from toniebox-reverse-engineering/develop
Nightly 20220501
2 parents e82aa81 + 4e35fa4 commit d904137

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

BoxPower.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ void BoxPower::_preparePowerDown() {
4747
Log.info("Prepare power down...");
4848
//TODO
4949
//smartconfig down
50-
Box.watchdog_stop();
50+
Box.logStreamMulti.flush();
51+
Box.boxPlayer.stop();
5152
setSdPower(false);
5253
setOtherPower(false);
5354
Box.boxLEDs.setAllBool(false);
5455
Serial.end();
56+
Box.watchdog_stop();
5557
}
5658
void BoxPower::reset() {
5759
Events.handlePowerEvent(PowerEvent::PRE_RESET);

Hackiebox.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ BoxConfig Config;
55
BoxEvents Events;
66
Hackiebox Box;
77

8+
9+
void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *pSlDeviceEvent) {
10+
Log.error("Received _SlDrvHandleGeneralEvents Event=%i", pSlDeviceEvent->Event);
11+
}
12+
int Report(const char *format, ...) {
13+
//Workaround for defined Report in the WiFi/utility/
14+
va_list args;
15+
va_start(args, format);
16+
Log.printFormat(format, args);
17+
return 0;
18+
}
819
void crash(crashSource source, uint32_t* sp) {
920
//Box.logStreamSse.setSsePaused(true);
1021
Log.info("crashSource=%i, sp=%X, sp=%X", source, sp, (uint32_t)sp-0x20004000);
@@ -30,6 +41,10 @@ void crash(crashSource source, uint32_t* sp) {
3041
_file.close();
3142
}
3243
Log.info("...done");
44+
45+
__asm__ volatile("bkpt");
46+
47+
Box.boxPower.hibernate();
3348
}
3449
void Hackiebox::setup() {
3550
if (!watchdog_start()) {

0 commit comments

Comments
 (0)