@@ -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.
0 commit comments