diff --git a/epicardium/modules/leds.c b/epicardium/modules/leds.c index c4e2ef7b0fd99e2875339e999a4d5cf19a0d6a14..eec9b5cb44f7c40e49c765c477bbc59ce06dc99d 100644 --- a/epicardium/modules/leds.c +++ b/epicardium/modules/leds.c @@ -102,7 +102,14 @@ void epic_leds_set_rocket(int led, uint8_t value) } uint8_t epic_leds_get_rocket(int led) { - pmic_get_led(led); + uint8_t ret = 0; + while (hwlock_acquire(HWLOCK_I2C, pdMS_TO_TICKS(1)) < 0) { + vTaskDelay(pdMS_TO_TICKS(1)); + } + + ret = pmic_get_led(led); + hwlock_release(HWLOCK_I2C); + return ret; } void epic_set_flashlight(bool power) diff --git a/pycardium/modules/py/leds.py b/pycardium/modules/py/leds.py index e2314f2292d4c97b51379564add5000cbcc1c812..ad1d014509569391fe050f29a07af8f62255eea4 100644 --- a/pycardium/modules/py/leds.py +++ b/pycardium/modules/py/leds.py @@ -87,7 +87,8 @@ def get_rocket(led): +-------+--------+----------+ | ``2`` | Green | Right | +-------+--------+----------+ - :return int: Brightness of LED (value between 0 and 31). + :rtype: int + :returns: Brightness of LED (value between 0 and 31). """ return sys_leds.get_rocket(led)