#include <stdio.h>
#define QUIT_TIMEOUT_US 1500000 // quit after 1.5 seconds holding pause button
#define QUIT_CHECK_US 100000 // check every 1/10 second
static const int us_delay[] = {400000, 170000, 100000};
static int mode;
static int toggle;
static void __on_pause_release(void)
{
printf("PAUSED\n");
}
printf("RUNNING\n");
}
fflush(stdout);
return;
}
static void __on_pause_press(void)
{
int i=0;
const int samples = QUIT_TIMEOUT_US/QUIT_CHECK_US;
for(i=0;i<samples;i++){
return;
}
}
printf("long press detected, shutting down\n");
return;
}
static void __on_mode_release(void)
{
if(mode<2) mode++;
else mode=0;
printf("setting mode: %d\n", mode);
return;
}
int main()
{
fprintf(stderr,"ERROR: failed to complete rc_enable_signal_handler\n");
return -1;
}
fprintf(stderr,"ERROR: failed to init buttons\n");
return -1;
}
fprintf(stderr,"ERROR: failed to init buttons\n");
return -1;
}
fprintf(stderr, "ERROR in rc_blink, failed to set RC_LED_GREEN\n");
return -1;
}
fprintf(stderr, "ERROR in rc_blink, failed to set RC_LED_RED\n");
return -1;
}
mode = 0;
printf("\nPress mode to change blink rate\n");
printf("hold pause button to exit\n");
if(toggle){
toggle = 0;
}
else{
toggle=1;
}
}
}
return 0;
}