Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
039066d8
Commit
039066d8
authored
Oct 04, 2019
by
zenox
Browse files
for annoyatron
parent
0f67e1d3
Changes
3
Show whitespace changes
Inline
Side-by-side
epicardium/modules/leds.c
View file @
039066d8
...
...
@@ -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
);
...
...
pycardium/modules/py/leds.py
View file @
039066d8
...
...
@@ -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
...
...
pycardium/modules/sys_leds.c
View file @
039066d8
...
...
@@ -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
)
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment