summaryrefslogtreecommitdiffstatshomepage
path: root/stm/led.c
diff options
context:
space:
mode:
Diffstat (limited to 'stm/led.c')
-rw-r--r--stm/led.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/stm/led.c b/stm/led.c
index d4bc0a0c87..eb7c76ef1f 100644
--- a/stm/led.c
+++ b/stm/led.c
@@ -176,15 +176,17 @@ mp_obj_t led_obj_off(mp_obj_t self_in) {
static MP_DEFINE_CONST_FUN_OBJ_1(led_obj_on_obj, led_obj_on);
static MP_DEFINE_CONST_FUN_OBJ_1(led_obj_off_obj, led_obj_off);
+static const mp_method_t led_methods[] = {
+ { "on", &led_obj_on_obj },
+ { "off", &led_obj_off_obj },
+ { NULL, NULL },
+};
+
static const mp_obj_type_t led_obj_type = {
{ &mp_const_type },
"Led",
.print = led_obj_print,
- .methods = {
- { "on", &led_obj_on_obj },
- { "off", &led_obj_off_obj },
- { NULL, NULL },
- }
+ .methods = led_methods,
};
mp_obj_t pyb_Led(mp_obj_t led_id) {