Add test mode flags

This commit is contained in:
d0k3 2017-05-21 20:56:57 +02:00
parent 8c968f8001
commit 3cf150a268
2 changed files with 15 additions and 0 deletions

View File

@ -43,6 +43,10 @@
// SafeB9SInstaller version // SafeB9SInstaller version
#define VERSION "0.0.5" #define VERSION "0.0.5"
// testfing flags, only useful to devs
// #define NO_WRITE // disables all NAND writes, just for testing
// #define FAIL_TEST // to test the emergency screen, only works with NO_TRANSFER defined
// input / output paths // input / output paths
#define INPUT_PATH "0:/boot9strap" #define INPUT_PATH "0:/boot9strap"

View File

@ -248,6 +248,7 @@ u32 SafeB9SInstaller(void) {
snprintf(msgInstall, 64, "FIRM install..."); snprintf(msgInstall, 64, "FIRM install...");
statusInstall = STATUS_YELLOW; statusInstall = STATUS_YELLOW;
ShowInstallerStatus(); ShowInstallerStatus();
#ifndef NO_WRITE
ShowProgress(0, 0, "FIRM install"); ShowProgress(0, 0, "FIRM install");
do { do {
ret = SafeWriteNand(FIRM_BUFFER, FIRM0_NAND_OFFSET, firm_size, 0x06); ret = SafeWriteNand(FIRM_BUFFER, FIRM0_NAND_OFFSET, firm_size, 0x06);
@ -280,6 +281,16 @@ u32 SafeB9SInstaller(void) {
} }
ShowInstallerStatus(); ShowInstallerStatus();
} }
#elif !defined FAIL_TEST
snprintf(msgInstall, 64, "test mode, not done");
statusInstall = STATUS_YELLOW;
return 0;
#else
snprintf(msgInstall, 64, "fail test mode...");
statusInstall = STATUS_YELLOW;
ShowInstallerStatus();
#endif
// if we end up here: uhoh // if we end up here: uhoh
ShowPrompt(false, "SafeB9SInstaller failed!\nThis really should not have happened :/."); ShowPrompt(false, "SafeB9SInstaller failed!\nThis really should not have happened :/.");