/* * Single click handler on up button */ static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) { // Make the snooze and the cancel buttons the same way around as the default alarm app #ifdef PBL_COLOR snooze_alarm(); #else cancel_alarm(); #endif // Bring clock up to date if a button is pressed revive_clock_on_movement(CLOCK_UPDATE_THRESHOLD); }
void wakeUp_User(){ mp3Player_onoff(); if(snoozeCounter == 0){ next_song(); } play_pause(); _delay_ms(1000);//warten bis mp3Player an ist boot_amp(); bool user_awake = false; LCD_LED = 1; LED_AUSTRALIA = 1; LED_NORWAY = 1; int secondsStart = seconds; while((!btn_light_pushed) && (rotary == 0) && (!btn_drehenc_pushed)){//Könnte auch von Sekundenzähler aufgewacht sein goodNight(); if(check_TimeUpdate()); update_time(); if(seconds == secondsStart + 30){ LCD_LED = 0; LED_AUSTRALIA = 0; LED_NORWAY = 0; } } LCD_LED = 0; LED_AUSTRALIA = 0; LED_NORWAY = 0; if(snoozeCounter==0){ if(btn_light_pushed){ //while(!btn_light_pushed){_delay_ms(100);} start_btnPress(); while((PINB & (1<<PINB1)) && (btn_press_duration<BTN_PRESS_LONG)){_delay_ms(50);} stop_btnPress(); if(btn_press_duration>=BTN_PRESS_LONG){ user_awake = true; } else { reset_alarmLogo(); print_snoozeLogo(); update_LCD(); snooze_alarm(); snoozeCounter = 1; } } else { reset_alarmLogo(); print_snoozeLogo(); update_LCD(); snooze_alarm(); snoozeCounter = 1; } } else { while(!user_awake){ goodNight(); if(check_TimeUpdate()) update_time(); start_btnPress(); while((PINB & (1<<PINB1)) && (btn_press_duration<BTN_PRESS_LONG)){_delay_ms(50);} stop_btnPress(); if(btn_press_duration>=BTN_PRESS_LONG){ user_awake = true; alarm = OFF; reset_alarmLogo(); reset_snoozeLogo(); snoozeCounter = 0; alarm_hour = saved_alarm_h; alarm_minute = saved_alarm_m; } } } play_pause();//Pause shutdown_amp(); mp3Player_onoff(); }
/* * Single click handler on up button */ static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) { revive_clock_on_movement(CLOCK_UPDATE_THRESHOLD); // Make the snooze and the cancel buttons the same way around as the default alarm app snooze_alarm(); }