Skip to content

Commit

Permalink
Add test mode flags
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k3 committed May 22, 2017
1 parent 8c968f8 commit 3cf150a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
// SafeB9SInstaller version
#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
#define INPUT_PATH "0:/boot9strap"

Expand Down
11 changes: 11 additions & 0 deletions source/installer.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ u32 SafeB9SInstaller(void) {
snprintf(msgInstall, 64, "FIRM install...");
statusInstall = STATUS_YELLOW;
ShowInstallerStatus();
#ifndef NO_WRITE
ShowProgress(0, 0, "FIRM install");
do {
ret = SafeWriteNand(FIRM_BUFFER, FIRM0_NAND_OFFSET, firm_size, 0x06);
Expand Down Expand Up @@ -280,6 +281,16 @@ u32 SafeB9SInstaller(void) {
}
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
ShowPrompt(false, "SafeB9SInstaller failed!\nThis really should not have happened :/.");
Expand Down

0 comments on commit 3cf150a

Please sign in to comment.