Commit 039066d8 authored by zenox's avatar zenox
Browse files

for annoyatron

parent 0f67e1d3
......@@ -145,11 +145,11 @@ int epic_leds_get_rocket(int led)
return ret;
}
static TimerHandle_t blink_timer[] = {NULL, NULL ,NULL};
static TimerHandle_t blink_timer[] = { NULL, NULL, NULL };
void bTimerCallback(TimerHandle_t blink_timer)
{
uint32_t id = (uint32_t) pvTimerGetTimerID(blink_timer);
uint32_t id = (uint32_t)pvTimerGetTimerID(blink_timer);
epic_leds_set_rocket(id, 0);
}
......@@ -162,7 +162,7 @@ void epic_leds_blink_rocket(int led, uint8_t value, int millis)
"blinktimer",
ticks,
pdFALSE,
(void*) id,
(void *)id,
bTimerCallback
);
epic_leds_set_rocket(led, value);
......
......@@ -94,6 +94,7 @@ def get_rocket(led):
"""
return sys_leds.get_rocket(led)
def blink_rocket(led, value, millis):
"""
Let one of the rockets blink for a certain time without
......
......@@ -213,7 +213,8 @@ static mp_obj_t mp_leds_get_rocket(mp_obj_t led_in)
}
static MP_DEFINE_CONST_FUN_OBJ_1(leds_get_rocket_obj, mp_leds_get_rocket);
static mp_obj_t mp_leds_blink_rocket(mp_obj_t led_in, mp_obj_t value_in, mp_obj_t time_in)
static mp_obj_t
mp_leds_blink_rocket(mp_obj_t led_in, mp_obj_t value_in, mp_obj_t time_in)
{
int led = mp_obj_get_int(led_in);
int value = mp_obj_get_int(value_in);
......@@ -298,7 +299,8 @@ static const mp_rom_map_elem_t leds_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_set_all_hsv), MP_ROM_PTR(&leds_set_all_hsv_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_rocket), MP_ROM_PTR(&leds_set_rocket_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_rocket), MP_ROM_PTR(&leds_get_rocket_obj) },
{ MP_ROM_QSTR(MP_QSTR_blink_rocket), MP_ROM_PTR(&leds_blink_rocket_obj) },
{ MP_ROM_QSTR(MP_QSTR_blink_rocket),
MP_ROM_PTR(&leds_blink_rocket_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_flashlight),
MP_ROM_PTR(&leds_set_flashlight_obj) },
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&leds_update_obj) },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment