Skip to content

Commit 4ba4c2a

Browse files
author
Marco van der Kolk
committed
Renamed 'datas' to 'data_pins' to keep codespell happy
Signed-off-by: Marco van der Kolk <[email protected]>
1 parent 5fcd90d commit 4ba4c2a

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

shared-module/keypad/ShiftRegisterKeys.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_
7070
}
7171

7272
// Allocate a tuple object with the data pins
73-
self->data = mp_obj_new_tuple(num_data_pins, dios);
73+
self->data_pins = mp_obj_new_tuple(num_data_pins, dios);
7474

7575
self->key_counts = (mp_uint_t *)gc_alloc(sizeof(mp_uint_t) * num_key_counts, false, false);
7676
self->num_key_counts = num_key_counts;
@@ -109,18 +109,13 @@ void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *
109109
common_hal_digitalio_digitalinout_deinit(self->clock);
110110
self->clock = MP_ROM_NONE;
111111

112-
/*
113-
common_hal_digitalio_digitalinout_deinit(self->data);
114-
self->data = MP_ROM_NONE;
115-
*/
116-
117112
common_hal_digitalio_digitalinout_deinit(self->latch);
118113
self->latch = MP_ROM_NONE;
119114

120-
for (size_t key = 0; key < self->datas->len; key++) {
121-
common_hal_digitalio_digitalinout_deinit(self->datas->items[key]);
115+
for (size_t key = 0; key < self->data_pins->len; key++) {
116+
common_hal_digitalio_digitalinout_deinit(self->data_pins->items[key]);
122117
}
123-
self->data = MP_ROM_NONE;
118+
self->data_pins = MP_ROM_NONE;
124119

125120
common_hal_keypad_deinit_core(self);
126121
}
@@ -153,7 +148,7 @@ static void shiftregisterkeys_scan_now(void *self_in, mp_obj_t timestamp) {
153148
// Loop through all the data pins that share the latch
154149
mp_uint_t index = 0;
155150

156-
for (mp_uint_t i = 0; i < self->datas->len; i++) {
151+
for (mp_uint_t i = 0; i < self->data_pins->len; i++) {
157152

158153
// When this data pin has less shiftable bits, ignore it
159154
if (scan_number >= self->key_counts[i]) {
@@ -168,7 +163,7 @@ static void shiftregisterkeys_scan_now(void *self_in, mp_obj_t timestamp) {
168163

169164
// Get the current state.
170165
const bool current =
171-
common_hal_digitalio_digitalinout_get_value(self->datas->items[i]) == self->value_when_pressed;
166+
common_hal_digitalio_digitalinout_get_value(self->data_pins->items[i]) == self->value_when_pressed;
172167
self->currently_pressed[key_number] = current;
173168

174169
// Record any transitions.

shared-module/keypad/ShiftRegisterKeys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct {
3838
KEYPAD_SCANNER_COMMON_FIELDS;
3939
digitalio_digitalinout_obj_t *clock;
4040
digitalio_digitalinout_obj_t *latch;
41-
mp_obj_tuple_t *data;
41+
mp_obj_tuple_t *data_pins;
4242
mp_uint_t *key_counts;
4343
mp_uint_t num_key_counts;
4444
mp_uint_t max_key_count;

0 commit comments

Comments
 (0)