diff options
| author | Jeff Epler <jepler@gmail.com> | 2021-03-16 12:21:50 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2021-03-16 12:21:50 -0500 |
| commit | 58679dc038e475d7cd00ee45256b7f906ecc2240 (patch) | |
| tree | 30cbc3f9e7e4efc81a43f364d554f33c1df34169 /shared-bindings/countio | |
| parent | 97b6664201de2530c9b92957a5e8d2a68524fa7e (diff) | |
| parent | bc690d4070c69e21d9070badc9f56a15d62ffb5d (diff) | |
Merge remote-tracking branch 'origin/main' into bitmap-read-2
Diffstat (limited to 'shared-bindings/countio')
| -rw-r--r-- | shared-bindings/countio/Counter.c | 16 | ||||
| -rw-r--r-- | shared-bindings/countio/Counter.h | 14 | ||||
| -rw-r--r-- | shared-bindings/countio/__init__.c | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 820db5ea9..e03665d63 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -41,7 +41,7 @@ STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); + const mcu_pin_obj_t *pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); countio_counter_obj_t *self = m_new_obj(countio_counter_obj_t); @@ -115,12 +115,12 @@ const mp_obj_property_t countio_counter_count_obj = { //| def reset(self) -> None: //| """Resets the count back to 0.""" //| -STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in){ - countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - //set the position to zero for reset - common_hal_countio_counter_reset(self); - return mp_const_none; +STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in) { + countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + // set the position to zero for reset + common_hal_countio_counter_reset(self); + return mp_const_none; } @@ -140,5 +140,5 @@ const mp_obj_type_t countio_counter_type = { { &mp_type_type }, .name = MP_QSTR_Counter, .make_new = countio_counter_make_new, - .locals_dict = (mp_obj_dict_t*)&countio_counter_locals_dict, + .locals_dict = (mp_obj_dict_t *)&countio_counter_locals_dict, }; diff --git a/shared-bindings/countio/Counter.h b/shared-bindings/countio/Counter.h index 15adbbe2a..a9eced41a 100644 --- a/shared-bindings/countio/Counter.h +++ b/shared-bindings/countio/Counter.h @@ -6,13 +6,13 @@ extern const mp_obj_type_t countio_counter_type; -extern void common_hal_countio_counter_construct(countio_counter_obj_t* self, - const mcu_pin_obj_t* pin_a); -extern void common_hal_countio_counter_deinit(countio_counter_obj_t* self); -extern bool common_hal_countio_counter_deinited(countio_counter_obj_t* self); -extern mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self); -extern void common_hal_countio_counter_set_count(countio_counter_obj_t* self, +extern void common_hal_countio_counter_construct(countio_counter_obj_t *self, + const mcu_pin_obj_t *pin_a); +extern void common_hal_countio_counter_deinit(countio_counter_obj_t *self); +extern bool common_hal_countio_counter_deinited(countio_counter_obj_t *self); +extern mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t *self); +extern void common_hal_countio_counter_set_count(countio_counter_obj_t *self, mp_int_t new_count); -extern void common_hal_countio_counter_reset(countio_counter_obj_t* self); +extern void common_hal_countio_counter_reset(countio_counter_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO_COUNTER_H diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index 7046a5e72..f6c0a4221 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -32,5 +32,5 @@ STATIC MP_DEFINE_CONST_DICT(countio_module_globals, countio_module_globals_table const mp_obj_module_t countio_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&countio_module_globals, + .globals = (mp_obj_dict_t *)&countio_module_globals, }; |
