int main(){ // Initialize Peripherals interface_init(); red_led_on(); uart_init(BAUDRATE); animation_manager_init(); sys_timer_start(); audio_init(); sei(); // enable global interrupts // Load Default Animation animation_manager_load_animation(START_ANIMATION); // Enter Setup if Requested _delay_ms(100); if(deb_switch_1()){ setup_wb_run(); } else if(deb_switch_2()){ setup_orientation_run(); } // Load Default Animation animation_manager_load_animation(START_ANIMATION); // Set White Balance _delay_ms(300); display_wb_update(); while(uart_async_run()); // setup white balance // Control Panel is Ready => Signal this by Turning the LED Green red_led_off(); green_led_on(); while(1){ // Sleep Mode if(!switch_on_off()){ // if switched off go_to_sleep(); } // Change animations sw_check(); if(sw_check_pressed(SW_LEFT, 200, true)){ animation_manager_dec_animation(); } else if(sw_check_pressed(SW_RIGHT, 200, true)){ animation_manager_inc_animation(); } else if(sw_check_pressed(SW_RAND, 300, true)){ animation_manager_random_animation(); } // Generate Image animation_manager_run(0); // Check Audio audio_start(); while(audio_run()); audio_process(); // Display Image while(uart_async_run()){ interface_async_run(); } } }
static void winwave_poll (void *opaque) { (void) opaque; audio_run ("winwave_poll"); }