fixed led flashing in programming mode being fucked

don't write code when sleep deprived you make stupid mistakes
This commit is contained in:
true 2024-08-08 03:51:24 -07:00
parent 3eb211fb54
commit 218819f75f
2 changed files with 4 additions and 2 deletions

View File

@ -59,10 +59,12 @@ void gpio_init()
// lightsense LED cathode // lightsense LED cathode
gpio.GPIO_Mode = GPIO_Mode_Out_PP; gpio.GPIO_Mode = GPIO_Mode_Out_PP;
gpio.GPIO_Pin = GPIO_Pin_2; gpio.GPIO_Pin = GPIO_Pin_2;
GPIOA->OUTDR = ~GPIO_Pin_2;
GPIO_Init(GPIOA, &gpio); GPIO_Init(GPIOA, &gpio);
// lightsense LED anode // lightsense LED anode
gpio.GPIO_Pin = GPIO_Pin_0; gpio.GPIO_Pin = GPIO_Pin_0;
GPIOD->OUTDR = ~GPIO_Pin_0;
GPIO_Init(GPIOD, &gpio); GPIO_Init(GPIOD, &gpio);
// unused pins // unused pins

View File

@ -529,7 +529,7 @@ void ui_render()
config_save_timer = UI_CONF_SAVE_TIMEOUT; config_save_timer = UI_CONF_SAVE_TIMEOUT;
// rapidly flash lsens // rapidly flash lsens
if ((tick >> 3) & 1) { if ((tick & 0x7) == 0) {
GPIOD->OUTDR ^= GPIO_Pin_0; GPIOD->OUTDR ^= GPIO_Pin_0;
} }
@ -573,7 +573,7 @@ void ui_render()
config_save_timer = UI_CONF_SAVE_TIMEOUT; config_save_timer = UI_CONF_SAVE_TIMEOUT;
// slowly flash lsnes // slowly flash lsnes
if ((tick >> 5) & 1) { if ((tick & 0x20) == 0) {
GPIOD->OUTDR ^= GPIO_Pin_0; GPIOD->OUTDR ^= GPIO_Pin_0;
} }