Permalink
Browse files

Added choice to instantly retry SD init or power off

Furthermore, fix invalid usage of strcat() in error.c
  • Loading branch information...
neonsea committed Aug 14, 2018
1 parent d334a38 commit 611ef44fad273a4d0e75cb4841622954804218df
Showing with 5 additions and 4 deletions.
  1. +1 −1 src/error.c
  2. +4 −3 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,11 +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");
print("Press any key to power off\n");
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();
i2c_send_byte(I2C_5, 0x3C, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_PWR_OFF);
}
print("Welcome to ReiNX %s!\n", VERSION);

0 comments on commit 611ef44

Please sign in to comment.