Skip to content

Commit

Permalink
add init_led
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Aug 30, 2024
1 parent 85165d7 commit 4c968ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static inline void start_blinking(uint8_t sec) {
static inline void start_quick_blinking(uint8_t sec) {
if (!is_nfc()) start_blinking_interval(sec, 25);
}
void init_led(void);
void stop_blinking(void);
uint8_t device_is_blinking(void);
bool device_allow_kbd_touch(void);
Expand Down
6 changes: 5 additions & 1 deletion src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ void start_blinking_interval(uint8_t sec, uint32_t interval) {

void stop_blinking(void) {
blink_timeout = 0;
last_blink = 0;
if (cfg_is_led_normally_on()) {
led_on();
led_status = ON;
Expand All @@ -179,3 +178,8 @@ void stop_blinking(void) {
led_status = OFF;
}
}

void init_led(void) {
last_blink = 0;
stop_blinking();
}

0 comments on commit 4c968ed

Please sign in to comment.