diff options
Diffstat (limited to 'stmhal/timer.c')
-rw-r--r-- | stmhal/timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/timer.c b/stmhal/timer.c index bd70eaa870..8a0d3f5bb6 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -57,7 +57,7 @@ static uint32_t tim3_counter = 0; // Used to do callbacks to Python code on interrupt STATIC pyb_timer_obj_t *pyb_timer_obj_all[14]; -#define PYB_TIMER_OBJ_ALL_NUM (sizeof(pyb_timer_obj_all) / sizeof(pyb_timer_obj_all[0])) +#define PYB_TIMER_OBJ_ALL_NUM ARRAY_SIZE(pyb_timer_obj_all) void timer_init0(void) { tim3_counter = 0; @@ -180,7 +180,7 @@ STATIC const mp_arg_parse_t pyb_timer_init_accepted_args[] = { { MP_QSTR_mode, MP_ARG_PARSE_KW_ONLY | MP_ARG_PARSE_INT, {.u_int = TIM_COUNTERMODE_UP} }, { MP_QSTR_div, MP_ARG_PARSE_KW_ONLY | MP_ARG_PARSE_INT, {.u_int = TIM_CLOCKDIVISION_DIV1} }, }; -#define PYB_TIMER_INIT_NUM_ARGS (sizeof(pyb_timer_init_accepted_args) / sizeof(pyb_timer_init_accepted_args[0])) +#define PYB_TIMER_INIT_NUM_ARGS ARRAY_SIZE(pyb_timer_init_accepted_args) STATIC mp_obj_t pyb_timer_init_helper(pyb_timer_obj_t *self, uint n_args, const mp_obj_t *args, mp_map_t *kw_args) { // parse args |