Struggling with UART
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user