Struggling with UART

This commit is contained in:
StefansE
2026-03-28 10:00:00 +01:00
parent e6e97f0412
commit 2c4eedfc60
4 changed files with 32 additions and 26 deletions

View File

@@ -10,13 +10,9 @@
// define LED marking 12:00 or 00:00
__attribute__((section(".noinit"))) volatile uint8_t ledOffset = 0;
#define LED_OFFSET 10
void clock_LedOffset(uint8_t offset){
ledOffset = offset;
}
uint8_t clock_convert_hours(uint8_t hours){
int8_t h = 0;
@@ -32,7 +28,7 @@ uint8_t clock_convert_hours(uint8_t hours){
h = hours;
}
led = 2 * h + ledOffset;
led = 2 * h + LED_OFFSET;
if(led > 23){
led -= 24;
}
@@ -50,7 +46,7 @@ uint8_t clock_convert_min_sec(uint8_t min_sec){
if(min_sec < 60){
led = (float) min_sec/(60/24);
led += ledOffset;
led += LED_OFFSET;
if(led > 23){
led -= 24;
}