diff options
Diffstat (limited to 'firmware/target/hosted/sdl/system-sdl.c')
-rw-r--r-- | firmware/target/hosted/sdl/system-sdl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index 9904da4346..572d6d570a 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c | |||
@@ -196,6 +196,14 @@ static int sdl_event_thread(void * param) | |||
196 | return 0; | 196 | return 0; |
197 | } | 197 | } |
198 | 198 | ||
199 | static bool quitting; | ||
200 | |||
201 | void sdl_sys_quit(void) | ||
202 | { | ||
203 | quitting = true; | ||
204 | sys_poweroff(); | ||
205 | } | ||
206 | |||
199 | void power_off(void) | 207 | void power_off(void) |
200 | { | 208 | { |
201 | /* Shut down SDL event loop */ | 209 | /* Shut down SDL event loop */ |
@@ -270,6 +278,11 @@ void system_reboot(void) | |||
270 | 278 | ||
271 | void system_exception_wait(void) | 279 | void system_exception_wait(void) |
272 | { | 280 | { |
281 | if (evt_thread) | ||
282 | { | ||
283 | while (!quitting) | ||
284 | SDL_Delay(10); | ||
285 | } | ||
273 | system_reboot(); | 286 | system_reboot(); |
274 | } | 287 | } |
275 | 288 | ||