UART commands work

This commit is contained in:
StefansE
2026-03-27 19:40:53 +01:00
parent ba8855eb21
commit e6e97f0412
10 changed files with 267 additions and 11 deletions

View File

@@ -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;
}