Only load firmware when required

This commit is contained in:
Robin Jones 2016-09-01 00:09:17 +01:00
parent 0345327c0d
commit 67fc6d0aa8
1 changed files with 7 additions and 7 deletions

14
menu.c
View File

@ -797,8 +797,13 @@ void configure() {
if (!(msg & (1 << 14))) {
msg |= 1 << 14;
evd_writeReg(REG_MAX_MSG, msg);
bi_load_firmware(firmware);
if (firm == 0x0214) {
int fpf = dfs_open("/firmware.bin");
firmware = malloc( dfs_size( fpf ) );
dfs_read( firmware, 1, dfs_size( fpf ), fpf );
dfs_close( fpf );
bi_load_firmware(firmware);
}
sleep(1);
evd_init();
@ -3012,11 +3017,6 @@ int main(void) {
printf("Filesystem failed to start!\n");
}
else {
int fpf = dfs_open("/firmware.bin");
firmware = malloc( dfs_size( fpf ) );
dfs_read( firmware, 1, dfs_size( fpf ), fpf );
dfs_close( fpf );
// everdrive initial function
configure();