Better to reboot here

This commit is contained in:
Aurora 2016-04-15 16:10:32 +02:00
parent fea5a111a9
commit c60ef7fe82
4 changed files with 12 additions and 8 deletions

View File

@ -9,7 +9,6 @@
#include "screeninit.h"
#include "draw.h"
#include "fs.h"
#include "i2c.h"
#include "buttons.h"
void configureCFW(const char *configPath)
@ -181,7 +180,5 @@ void configureCFW(const char *configPath)
//Zero the last booted FIRM flag
CFG_BOOTENV = 0;
//Reboot
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
while(1);
mcuReboot();
}

View File

@ -55,7 +55,7 @@ void main(void)
//Determine if this is a firmlaunch boot
if(*(vu8 *)0x23F00005)
{
if(needConfig == 2) shutDown();
if(needConfig == 2) mcuReboot();
bootType = 1;

View File

@ -37,12 +37,18 @@ u32 waitInput(void)
return key;
}
void shutDown(void)
void mcuShutDown(void)
{
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1);
while(1);
}
void mcuReboot(void)
{
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
while(1);
}
void error(const char *message)
{
initScreens();
@ -53,5 +59,5 @@ void error(const char *message)
waitInput();
shutDown();
mcuShutDown();
}

View File

@ -9,5 +9,6 @@
#include "types.h"
u32 waitInput(void);
void shutDown(void);
void mcuShutDown(void);
void mcuReboot(void);
void error(const char *message);