Skip to content
Permalink
Browse files

rework button logic people trying to get into maintence mode early in…

… boot.
  • Loading branch information...
Reisyukaku committed Apr 18, 2019
1 parent fe94f6a commit c10906400d56dd0d5fd76ed18a9005543f766c94
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/firmware.c
@@ -220,6 +220,7 @@ void launch() {
*BOOT_STATE_ADDR = (pk11Offs->kb < KB_FIRMWARE_VERSION_400 ? BOOT_PKG2_LOADED : BOOT_PKG2_LOADED_4X);
*SECMON_STATE_ADDR = 0;
}

// Disable display.
display_end();

@@ -249,6 +250,7 @@ void firmware() {
gfx_clear_color(&gfx_ctxt, BLACK);
gfx_con_init(&gfx_con, &gfx_ctxt);
gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0);
u32 currBut = btn_read();

//Mount SD
if (!sdMount()) {
@@ -281,7 +283,7 @@ void firmware() {
PMC(APBDEV_PMC_SCRATCH49) = 0;

//Chainload recovery if applicable
if(btn_read() & BTN_VOL_UP){
if((currBut & BTN_VOL_UP) && !(currBut & BTN_VOL_DOWN)){
if(fopen("/ReiNX/Recovery.bin", "rb") != 0) {
fread((void*)PAYLOAD_ADDR, fsize(), 1);
fclose();
@@ -302,7 +304,7 @@ void firmware() {
}

//Determine if booting in verbose mode
if (btn_read() & BTN_VOL_DOWN) {
if ((currBut & BTN_VOL_DOWN) && !(currBut & BTN_VOL_UP)) {
print("%kWelcome to ReiNX %d.%d!\n%k", WHITE, VERSION_MAJOR, VERSION_MINOR, DEFAULT_TEXT_COL);
} else if (drawSplash()) {
gfx_con.mute = 1;

0 comments on commit c109064

Please sign in to comment.
You can’t perform that action at this time.