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

View File

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

View File

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

View File

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