Permalink
Browse files

Merge pull request #35 from neonsea/master

Fix hang when SD card fails to init
  • Loading branch information...
Reisyukaku committed Aug 14, 2018
2 parents d470325 + 611ef44 commit dbc0282667b3a70a037de9f7edb506cf27ca561c
Showing with 6 additions and 3 deletions.
  1. +1 −1 src/error.c
  2. +5 −2 src/firmware.c
View
@@ -31,6 +31,6 @@ void panic() {
void error(char *errStr) {
gfx_con_setcol(&gfx_con, RED, 0, 0);
print(strcat("Error: ", errStr));
print("Error: %s", errStr);
gfx_con_setcol(&gfx_con, ORANGE, 0, 0);
}
View
@@ -398,9 +398,12 @@ void firmware() {
gfx_con_init(&gfx_con, &gfx_ctxt);
gfx_con_setcol(&gfx_con, ORANGE, 0, 0);
if (!sd_mount()) {
while (!sd_mount()) {
error("Failed to init SD card!\n");
return;
print("Press POWER to power off, any other key to retry\n");
if (btn_wait() & BTN_POWER)
i2c_send_byte(I2C_5, 0x3C, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_PWR_OFF);
btn_wait();
}
print("Welcome to ReiNX %s!\n", VERSION);

0 comments on commit dbc0282

Please sign in to comment.