/* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. * (c) 2014 Stefan Rupp * ---------------------------------------------------------------------------- */ #include "rgbyteclock.h" #include "timer.h" #include "rtc.h" #include "lcd.h" #include "ledcontroller.h" void rgbyteclock_rounds(void) { ledcontroller_turn_all_on(); while (1) { //PORTC ^= (1< 11) { l_mins_next = 0; } if (l_hours_next > 11) { l_hours_next = 0; } uint16_t d_m1, d_m2; uint16_t d_h1, d_h2; d_m2 = ((mins%5)*0x7ffUL)/4; d_h2 = ((hours%5)*0xfffUL)/4; d_m1 = ((4-(mins%5))*0x7ffUL)/4; d_h1 = ((4-(hours%5))*0xfffUL)/4; ledcontroller_clear(); for (int led=0;led<12;led++) { led_set(led, 0x000f, 0, 0); } if (l_mins != l_hours) { led_set(l_mins, 0xf, d_m1, 0); led_set(l_hours, 0xf, 0, d_h1); led_set(l_mins_next, 0xf, d_m2, 0); led_set(l_hours_next, 0xf, 0, d_h2); } else { led_set(l_mins, 0xf, d_m1, d_h1); led_set(l_mins_next, 0xf, d_m2, d_h2); } led_flush(); } } } void rgbyteclock(void) { //rgbyteclock_rounds(); //rgbyteclock_secwatch(); rgbyteclock_secwatch_glide(); }