Skip to content

Commit 2e67d67

Browse files
committed
check_for_deinit() more places in scanners
1 parent 4f538b6 commit 2e67d67

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

shared-bindings/keypad/KeyMatrix.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) {
150150
//|
151151
STATIC mp_obj_t keypad_keymatrix_reset(mp_obj_t self_in) {
152152
keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in);
153+
check_for_deinit(self);
153154

154155
common_hal_keypad_keymatrix_reset(self);
155156
return MP_ROM_NONE;
@@ -162,6 +163,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_reset_obj, keypad_keymatrix_reset);
162163
//|
163164
STATIC mp_obj_t keypad_keymatrix_get_key_count(mp_obj_t self_in) {
164165
keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in);
166+
check_for_deinit(self);
167+
165168
return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keymatrix_get_key_count(self));
166169
}
167170
MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_key_count_obj, keypad_keymatrix_get_key_count);
@@ -231,6 +234,8 @@ MP_DEFINE_CONST_FUN_OBJ_3(keypad_keymatrix_row_column_to_key_number_obj, keypad_
231234
//|
232235
STATIC mp_obj_t keypad_keymatrix_get_events(mp_obj_t self_in) {
233236
keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in);
237+
check_for_deinit(self);
238+
234239
return common_hal_keypad_keymatrix_get_events(self);
235240
}
236241
MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_events_obj, keypad_keymatrix_get_events);

shared-bindings/keypad/Keys.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ STATIC void check_for_deinit(keypad_keys_obj_t *self) {
144144
//|
145145
STATIC mp_obj_t keypad_keys_reset(mp_obj_t self_in) {
146146
keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in);
147+
check_for_deinit(self);
147148

148149
common_hal_keypad_keys_reset(self);
149150
return MP_ROM_NONE;
@@ -156,6 +157,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_reset_obj, keypad_keys_reset);
156157
//|
157158
STATIC mp_obj_t keypad_keys_get_key_count(mp_obj_t self_in) {
158159
keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in);
160+
check_for_deinit(self);
161+
159162
return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keys_get_key_count(self));
160163
}
161164
MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_key_count_obj, keypad_keys_get_key_count);
@@ -173,6 +176,8 @@ const mp_obj_property_t keypad_keys_key_count_obj = {
173176
//|
174177
STATIC mp_obj_t keypad_keys_get_events(mp_obj_t self_in) {
175178
keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in);
179+
check_for_deinit(self);
180+
176181
return common_hal_keypad_keys_get_events(self);
177182
}
178183
MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_events_obj, keypad_keys_get_events);

shared-bindings/keypad/ShiftRegisterKeys.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ STATIC void check_for_deinit(keypad_shiftregisterkeys_obj_t *self) {
148148
//|
149149
STATIC mp_obj_t keypad_shiftregisterkeys_reset(mp_obj_t self_in) {
150150
keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in);
151+
check_for_deinit(self);
151152

152153
common_hal_keypad_shiftregisterkeys_reset(self);
153154
return MP_ROM_NONE;
@@ -160,6 +161,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_reset_obj, keypad_shiftregist
160161
//|
161162
STATIC mp_obj_t keypad_shiftregisterkeys_get_key_count(mp_obj_t self_in) {
162163
keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in);
164+
check_for_deinit(self);
165+
163166
return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_shiftregisterkeys_get_key_count(self));
164167
}
165168
MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_key_count_obj, keypad_shiftregisterkeys_get_key_count);
@@ -177,6 +180,8 @@ const mp_obj_property_t keypad_shiftregisterkeys_key_count_obj = {
177180
//|
178181
STATIC mp_obj_t keypad_shiftregisterkeys_get_events(mp_obj_t self_in) {
179182
keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in);
183+
check_for_deinit(self);
184+
180185
return common_hal_keypad_shiftregisterkeys_get_events(self);
181186
}
182187
MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_events_obj, keypad_shiftregisterkeys_get_events);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy