Skip to content

Commit 6dab35e

Browse files
author
Marco van der Kolk
committed
Assign key_count to MP_ROM_NONE on deinit (for gc)
Signed-off-by: Marco van der Kolk <[email protected]>
1 parent 4ba4c2a commit 6dab35e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-module/keypad/ShiftRegisterKeys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *
116116
common_hal_digitalio_digitalinout_deinit(self->data_pins->items[key]);
117117
}
118118
self->data_pins = MP_ROM_NONE;
119+
self->key_counts = MP_ROM_NONE;
119120

120121
common_hal_keypad_deinit_core(self);
121122
}
@@ -125,8 +126,7 @@ size_t shiftregisterkeys_get_key_count(void *self_in) {
125126

126127
size_t total = 0;
127128

128-
for (mp_uint_t i = 0; i < self->num_key_counts; i++)
129-
{
129+
for (mp_uint_t i = 0; i < self->num_key_counts; i++) {
130130
total += self->key_counts[i];
131131
}
132132

0 commit comments

Comments
 (0)