Skip to content
Snippets Groups Projects
Verified Commit e40b9176 authored by genofire's avatar genofire
Browse files

review fix of get rocket state

parent a119d27c
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment