Skip to content
Snippets Groups Projects
Commit 9c5d8003 authored by rahix's avatar rahix Committed by schneider
Browse files

fix(leds): Add a missing I2C bus-lock


leds_update_power() internally accesses the I2C bus so calls to this
function need to be inside an I2C lock section.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 0702114c
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
static void do_update(void) static void do_update(void)
{ {
hwlock_acquire(HWLOCK_LED); hwlock_acquire(HWLOCK_LED);
hwlock_acquire(HWLOCK_I2C);
leds_update_power(); leds_update_power();
leds_update(); leds_update();
hwlock_release(HWLOCK_I2C);
hwlock_release(HWLOCK_LED); hwlock_release(HWLOCK_LED);
} }
......
...@@ -125,9 +125,13 @@ void vLedTask(void *pvParameters) ...@@ -125,9 +125,13 @@ void vLedTask(void *pvParameters)
(float)(1000 / (float)(1000 /
led_animation_rate)))); led_animation_rate))));
} }
hwlock_acquire(HWLOCK_I2C);
leds_update_power(); leds_update_power();
leds_update(); leds_update();
hwlock_release(HWLOCK_I2C);
hwlock_release(HWLOCK_LED); hwlock_release(HWLOCK_LED);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment