diff options
Diffstat (limited to 'common/lightbar.c')
-rw-r--r-- | common/lightbar.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index 9b48168faa..2355067016 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -993,20 +993,20 @@ static uint32_t sequence_TAP_inner(int dir) #endif f_osc = st.p.tap_seg_osc * FP_SCALE / 100; - start = get_time(); - while (1) { - get_battery_level(); + get_battery_level(); - if (st.battery_level == 0) - base_color = RED; - else if (st.battery_percent > st.p.tap_pct_green) - base_color = GREEN; - else - base_color = YELLOW; + if (st.battery_level == 0) + base_color = RED; + else if (st.battery_percent > st.p.tap_pct_green) + base_color = GREEN; + else + base_color = YELLOW; - ci = st.p.tap_idx[base_color]; - max_led = st.battery_percent / CUT; + ci = st.p.tap_idx[base_color]; + max_led = st.battery_percent / CUT; + start = get_time(); + while (1) { /* Enable the segments gradually */ gi = elapsed_time / st.p.tap_gate_delay; gr = elapsed_time % st.p.tap_gate_delay; |