@ -502,11 +502,9 @@ static void animate_shooting_stars(void) {
* Calls all different animations at different rates
* Calls all different animations at different rates
*/
*/
void render_stars ( void ) {
void render_stars ( void ) {
// // animation timer
if ( timer_elapsed32 ( starry_night_anim_timer ) > STARRY_NIGHT_ANIM_FRAME_DURATION ) {
starry_night_anim_timer = timer_read32 ( ) ;
current_wpm = get_current_wpm ( ) ;
current_wpm = get_current_wpm ( ) ;
void render_stars_anim ( void ) {
# ifdef ENABLE_ISLAND
# ifdef ENABLE_ISLAND
animate_island ( ) ;
animate_island ( ) ;
# endif
# endif
@ -545,9 +543,12 @@ void render_stars(void) {
animation_counter = increment_counter ( animation_counter , NUMBER_OF_FRAMES ) ;
animation_counter = increment_counter ( animation_counter , NUMBER_OF_FRAMES ) ;
}
}
// this fixes the screen on and off bug
if ( current_wpm > 0 ) {
// Turn screen on/off based on typing and timeout
if ( current_wpm > 0 & & timer_elapsed32 ( starry_night_anim_timer ) > STARRY_NIGHT_ANIM_FRAME_DURATION ) {
starry_night_anim_timer = timer_read32 ( ) ;
oled_on ( ) ;
oled_on ( ) ;
render_stars_anim ( ) ;
starry_night_anim_sleep = timer_read32 ( ) ;
starry_night_anim_sleep = timer_read32 ( ) ;
} else if ( timer_elapsed32 ( starry_night_anim_sleep ) > OLED_TIMEOUT ) {
} else if ( timer_elapsed32 ( starry_night_anim_sleep ) > OLED_TIMEOUT ) {
oled_off ( ) ;
oled_off ( ) ;