Skip to content

Commit

Permalink
sandbox: Fix quiting when the LCD window is closed
Browse files Browse the repository at this point in the history
With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.

Use the correct sysreset type to tell it to shut down.

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Jul 14, 2023
1 parent def898c commit 06d3414
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/sandbox/cpu/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <errno.h>
#include <unistd.h>
#include <stdbool.h>
#include <sysreset.h>
#include <linux/input.h>
#include <SDL2/SDL.h>
#include <asm/state.h>
Expand Down Expand Up @@ -81,7 +82,7 @@ static void sandbox_sdl_poll_events(void)
switch (event.type) {
case SDL_QUIT:
puts("LCD window closed - quitting\n");
reset_cpu();
sysreset_walk(SYSRESET_POWER_OFF);
break;
}
}
Expand Down

0 comments on commit 06d3414

Please sign in to comment.