Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created September 22, 2016 20:25
Show Gist options
  • Save pamaury/02b33eb18e16ee1a916f80028d0baadc to your computer and use it in GitHub Desktop.
Save pamaury/02b33eb18e16ee1a916f80028d0baadc to your computer and use it in GitHub Desktop.
#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