Created
September 22, 2016 20:25
-
-
Save pamaury/02b33eb18e16ee1a916f80028d0baadc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if defined(SANSA_FUZEPLUS) | |
static enum boot_t boot_decision(enum context_t context) | |
{ | |
return BOOT_ROCK; | |
/* if volume down is hold, boot to OF */ | |
if(!read_gpio(1, 30)) | |
return BOOT_OF; | |
/* on normal boot, make sure power button is hold long enough */ | |
if(context == CONTEXT_NORMAL) | |
{ | |
// monitor PSWITCH | |
int count = 0; | |
for(int i = 0; i < 550000; i++) | |
if(read_pswitch() == 1) | |
count++; | |
if(count < 400000) | |
return BOOT_STOP; | |
} | |
return BOOT_ROCK; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment