UART commands work
This commit is contained in:
@@ -9,7 +9,13 @@
|
||||
#include "clock.h"
|
||||
|
||||
// define LED marking 12:00 or 00:00
|
||||
#define LED_ZERO_OFFSET 10
|
||||
|
||||
__attribute__((section(".noinit"))) volatile uint8_t ledOffset = 0;
|
||||
|
||||
|
||||
void clock_LedOffset(uint8_t offset){
|
||||
ledOffset = offset;
|
||||
}
|
||||
|
||||
|
||||
uint8_t clock_convert_hours(uint8_t hours){
|
||||
@@ -26,7 +32,7 @@ uint8_t clock_convert_hours(uint8_t hours){
|
||||
h = hours;
|
||||
}
|
||||
|
||||
led = 2 * h + LED_ZERO_OFFSET;
|
||||
led = 2 * h + ledOffset;
|
||||
if(led > 23){
|
||||
led -= 24;
|
||||
}
|
||||
@@ -44,7 +50,7 @@ uint8_t clock_convert_min_sec(uint8_t min_sec){
|
||||
if(min_sec < 60){
|
||||
led = (float) min_sec/(60/24);
|
||||
|
||||
led += LED_ZERO_OFFSET;
|
||||
led += ledOffset;
|
||||
if(led > 23){
|
||||
led -= 24;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user