Skip to content
Snippets Groups Projects
Verified Commit d293ce3c authored by rahix's avatar rahix
Browse files

chore(pycardium): Use `static` instead of `STATIC`


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 6e001276
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ void epic_isr_default_handler(api_int_id_t id) ...@@ -23,7 +23,7 @@ void epic_isr_default_handler(api_int_id_t id)
} }
} }
STATIC mp_obj_t mp_interrupt_set_callback(mp_obj_t id_in, mp_obj_t callback_obj) static mp_obj_t mp_interrupt_set_callback(mp_obj_t id_in, mp_obj_t callback_obj)
{ {
api_int_id_t id = mp_obj_get_int(id_in); api_int_id_t id = mp_obj_get_int(id_in);
if (callback_obj != mp_const_none && if (callback_obj != mp_const_none &&
...@@ -39,7 +39,7 @@ STATIC mp_obj_t mp_interrupt_set_callback(mp_obj_t id_in, mp_obj_t callback_obj) ...@@ -39,7 +39,7 @@ STATIC mp_obj_t mp_interrupt_set_callback(mp_obj_t id_in, mp_obj_t callback_obj)
return mp_const_none; return mp_const_none;
} }
STATIC mp_obj_t mp_interrupt_enable_callback(mp_obj_t id_in) static mp_obj_t mp_interrupt_enable_callback(mp_obj_t id_in)
{ {
api_int_id_t id = mp_obj_get_int(id_in); api_int_id_t id = mp_obj_get_int(id_in);
...@@ -50,7 +50,7 @@ STATIC mp_obj_t mp_interrupt_enable_callback(mp_obj_t id_in) ...@@ -50,7 +50,7 @@ STATIC mp_obj_t mp_interrupt_enable_callback(mp_obj_t id_in)
return mp_const_none; return mp_const_none;
} }
STATIC mp_obj_t mp_interrupt_disable_callback(mp_obj_t id_in) static mp_obj_t mp_interrupt_disable_callback(mp_obj_t id_in)
{ {
api_int_id_t id = mp_obj_get_int(id_in); api_int_id_t id = mp_obj_get_int(id_in);
...@@ -61,18 +61,17 @@ STATIC mp_obj_t mp_interrupt_disable_callback(mp_obj_t id_in) ...@@ -61,18 +61,17 @@ STATIC mp_obj_t mp_interrupt_disable_callback(mp_obj_t id_in)
return mp_const_none; return mp_const_none;
} }
static MP_DEFINE_CONST_FUN_OBJ_2(
STATIC MP_DEFINE_CONST_FUN_OBJ_2(
interrupt_set_callback_obj, mp_interrupt_set_callback interrupt_set_callback_obj, mp_interrupt_set_callback
); );
STATIC MP_DEFINE_CONST_FUN_OBJ_1( static MP_DEFINE_CONST_FUN_OBJ_1(
interrupt_enable_callback_obj, mp_interrupt_enable_callback interrupt_enable_callback_obj, mp_interrupt_enable_callback
); );
STATIC MP_DEFINE_CONST_FUN_OBJ_1( static MP_DEFINE_CONST_FUN_OBJ_1(
interrupt_disable_callback_obj, mp_interrupt_disable_callback interrupt_disable_callback_obj, mp_interrupt_disable_callback
); );
STATIC const mp_rom_map_elem_t interrupt_module_globals_table[] = { static const mp_rom_map_elem_t interrupt_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_interrupt) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_interrupt) },
{ MP_ROM_QSTR(MP_QSTR_set_callback), { MP_ROM_QSTR(MP_QSTR_set_callback),
MP_ROM_PTR(&interrupt_set_callback_obj) }, MP_ROM_PTR(&interrupt_set_callback_obj) },
...@@ -82,7 +81,7 @@ STATIC const mp_rom_map_elem_t interrupt_module_globals_table[] = { ...@@ -82,7 +81,7 @@ STATIC const mp_rom_map_elem_t interrupt_module_globals_table[] = {
MP_ROM_PTR(&interrupt_disable_callback_obj) }, MP_ROM_PTR(&interrupt_disable_callback_obj) },
{ MP_ROM_QSTR(MP_QSTR_BHI160), MP_OBJ_NEW_SMALL_INT(2) }, { MP_ROM_QSTR(MP_QSTR_BHI160), MP_OBJ_NEW_SMALL_INT(2) },
}; };
STATIC MP_DEFINE_CONST_DICT( static MP_DEFINE_CONST_DICT(
interrupt_module_globals, interrupt_module_globals_table interrupt_module_globals, interrupt_module_globals_table
); );
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "py/builtin.h" #include "py/builtin.h"
#include "epicardium.h" #include "epicardium.h"
STATIC mp_obj_t mp_light_sensor_start() static mp_obj_t mp_light_sensor_start()
{ {
int status = epic_light_sensor_run(); int status = epic_light_sensor_run();
if (status == -EBUSY) { if (status == -EBUSY) {
...@@ -13,9 +13,9 @@ STATIC mp_obj_t mp_light_sensor_start() ...@@ -13,9 +13,9 @@ STATIC mp_obj_t mp_light_sensor_start()
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(light_sensor_start_obj, mp_light_sensor_start); static MP_DEFINE_CONST_FUN_OBJ_0(light_sensor_start_obj, mp_light_sensor_start);
STATIC mp_obj_t mp_light_sensor_get_reading() static mp_obj_t mp_light_sensor_get_reading()
{ {
uint16_t last; uint16_t last;
int status = epic_light_sensor_get(&last); int status = epic_light_sensor_get(&last);
...@@ -25,11 +25,11 @@ STATIC mp_obj_t mp_light_sensor_get_reading() ...@@ -25,11 +25,11 @@ STATIC mp_obj_t mp_light_sensor_get_reading()
} }
return mp_obj_new_int_from_uint(last); return mp_obj_new_int_from_uint(last);
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0( static MP_DEFINE_CONST_FUN_OBJ_0(
light_sensor_get_obj, mp_light_sensor_get_reading light_sensor_get_obj, mp_light_sensor_get_reading
); );
STATIC mp_obj_t mp_light_sensor_stop() static mp_obj_t mp_light_sensor_stop()
{ {
int status = epic_light_sensor_stop(); int status = epic_light_sensor_stop();
if (status == -EBUSY) { if (status == -EBUSY) {
...@@ -39,15 +39,15 @@ STATIC mp_obj_t mp_light_sensor_stop() ...@@ -39,15 +39,15 @@ STATIC mp_obj_t mp_light_sensor_stop()
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(light_sensor_stop_obj, mp_light_sensor_stop); static MP_DEFINE_CONST_FUN_OBJ_0(light_sensor_stop_obj, mp_light_sensor_stop);
STATIC const mp_rom_map_elem_t light_sensor_module_globals_table[] = { static const mp_rom_map_elem_t light_sensor_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_light_sensor) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_light_sensor) },
{ MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&light_sensor_start_obj) }, { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&light_sensor_start_obj) },
{ MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&light_sensor_stop_obj) }, { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&light_sensor_stop_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_reading), MP_ROM_PTR(&light_sensor_get_obj) } { MP_ROM_QSTR(MP_QSTR_get_reading), MP_ROM_PTR(&light_sensor_get_obj) }
}; };
STATIC MP_DEFINE_CONST_DICT( static MP_DEFINE_CONST_DICT(
light_sensor_module_globals, light_sensor_module_globals_table light_sensor_module_globals, light_sensor_module_globals_table
); );
......
...@@ -48,7 +48,7 @@ static mp_obj_t mp_display_print(size_t n_args, const mp_obj_t *args) ...@@ -48,7 +48,7 @@ static mp_obj_t mp_display_print(size_t n_args, const mp_obj_t *args)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN( static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_print_obj, 5, 5, mp_display_print display_print_obj, 5, 5, mp_display_print
); );
...@@ -74,7 +74,7 @@ static mp_obj_t mp_display_pixel(size_t n_args, const mp_obj_t *args) ...@@ -74,7 +74,7 @@ static mp_obj_t mp_display_pixel(size_t n_args, const mp_obj_t *args)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN( static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_pixel_obj, 3, 3, mp_display_pixel display_pixel_obj, 3, 3, mp_display_pixel
); );
...@@ -108,7 +108,7 @@ static mp_obj_t mp_display_line(size_t n_args, const mp_obj_t *args) ...@@ -108,7 +108,7 @@ static mp_obj_t mp_display_line(size_t n_args, const mp_obj_t *args)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN( static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_line_obj, 7, 7, mp_display_line display_line_obj, 7, 7, mp_display_line
); );
...@@ -142,7 +142,7 @@ static mp_obj_t mp_display_rect(size_t n_args, const mp_obj_t *args) ...@@ -142,7 +142,7 @@ static mp_obj_t mp_display_rect(size_t n_args, const mp_obj_t *args)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN( static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_rect_obj, 7, 7, mp_display_rect display_rect_obj, 7, 7, mp_display_rect
); );
...@@ -166,7 +166,7 @@ static mp_obj_t mp_display_circ(size_t n_args, const mp_obj_t *args) ...@@ -166,7 +166,7 @@ static mp_obj_t mp_display_circ(size_t n_args, const mp_obj_t *args)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN( static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_circ_obj, 6, 6, mp_display_circ display_circ_obj, 6, 6, mp_display_circ
); );
...@@ -180,7 +180,7 @@ static mp_obj_t mp_display_clear(mp_obj_t col) ...@@ -180,7 +180,7 @@ static mp_obj_t mp_display_clear(mp_obj_t col)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_clear_obj, mp_display_clear); static MP_DEFINE_CONST_FUN_OBJ_1(display_clear_obj, mp_display_clear);
static mp_obj_t mp_display_update() static mp_obj_t mp_display_update()
{ {
...@@ -190,7 +190,7 @@ static mp_obj_t mp_display_update() ...@@ -190,7 +190,7 @@ static mp_obj_t mp_display_update()
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_update_obj, mp_display_update); static MP_DEFINE_CONST_FUN_OBJ_0(display_update_obj, mp_display_update);
static mp_obj_t mp_display_open() static mp_obj_t mp_display_open()
{ {
...@@ -200,7 +200,7 @@ static mp_obj_t mp_display_open() ...@@ -200,7 +200,7 @@ static mp_obj_t mp_display_open()
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_open_obj, mp_display_open); static MP_DEFINE_CONST_FUN_OBJ_0(display_open_obj, mp_display_open);
static mp_obj_t mp_display_close() static mp_obj_t mp_display_close()
{ {
...@@ -210,7 +210,7 @@ static mp_obj_t mp_display_close() ...@@ -210,7 +210,7 @@ static mp_obj_t mp_display_close()
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_close_obj, mp_display_close); static MP_DEFINE_CONST_FUN_OBJ_0(display_close_obj, mp_display_close);
/* The globals table for this module */ /* The globals table for this module */
static const mp_rom_map_elem_t display_module_globals_table[] = { static const mp_rom_map_elem_t display_module_globals_table[] = {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "py/builtin.h" #include "py/builtin.h"
#include "epicardium.h" #include "epicardium.h"
STATIC mp_obj_t mp_vibra_set(mp_obj_t state_obj) static mp_obj_t mp_vibra_set(mp_obj_t state_obj)
{ {
if (state_obj == mp_const_true) { if (state_obj == mp_const_true) {
epic_vibra_set(1); epic_vibra_set(1);
...@@ -14,22 +14,22 @@ STATIC mp_obj_t mp_vibra_set(mp_obj_t state_obj) ...@@ -14,22 +14,22 @@ STATIC mp_obj_t mp_vibra_set(mp_obj_t state_obj)
} }
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(vibra_set_obj, mp_vibra_set); static MP_DEFINE_CONST_FUN_OBJ_1(vibra_set_obj, mp_vibra_set);
STATIC mp_obj_t mp_vibra_vibrate(mp_obj_t a_obj) static mp_obj_t mp_vibra_vibrate(mp_obj_t a_obj)
{ {
int millis = mp_obj_get_int(a_obj); int millis = mp_obj_get_int(a_obj);
epic_vibra_vibrate(millis); epic_vibra_vibrate(millis);
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(vibra_vibrate_obj, mp_vibra_vibrate); static MP_DEFINE_CONST_FUN_OBJ_1(vibra_vibrate_obj, mp_vibra_vibrate);
STATIC const mp_rom_map_elem_t vibra_module_globals_table[] = { static const mp_rom_map_elem_t vibra_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_vibra) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_vibra) },
{ MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&vibra_set_obj) }, { MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&vibra_set_obj) },
{ MP_ROM_QSTR(MP_QSTR_vibrate), MP_ROM_PTR(&vibra_vibrate_obj) } { MP_ROM_QSTR(MP_QSTR_vibrate), MP_ROM_PTR(&vibra_vibrate_obj) }
}; };
STATIC MP_DEFINE_CONST_DICT(vibra_module_globals, vibra_module_globals_table); static MP_DEFINE_CONST_DICT(vibra_module_globals, vibra_module_globals_table);
// Define module object. // Define module object.
const mp_obj_module_t vibra_module = { const mp_obj_module_t vibra_module = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment