Skip to content

Commit bb683fa

Browse files
committed
Renamed module 'keypaddemux' in 'keypad_demux' and fix documentation
1 parent f603377 commit bb683fa

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

docs/shared_bindings_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"keypad.KeyMatrix": "CIRCUITPY_KEYPAD_KEYMATRIX",
7979
"keypad.Keys": "CIRCUITPY_KEYPAD_KEYS",
8080
"keypad.ShiftRegisterKeys": "CIRCUITPY_KEYPAD_SHIFTREGISTERKEYS",
81-
"keypaddemux.DemuxKeyMatrix": "CIRCUITPY_KEYPAD_DEMUX",
81+
"keypad_demux.DemuxKeyMatrix": "CIRCUITPY_KEYPAD_DEMUX",
8282
"os.getenv": "CIRCUITPY_OS_GETENV",
8383
"select": "MICROPY_PY_SELECT_SELECT",
8484
"sys": "CIRCUITPY_SYS",

py/circuitpy_defns.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ ifeq ($(CIRCUITPY_KEYPAD),1)
253253
SRC_PATTERNS += keypad/%
254254
endif
255255
ifeq ($(CIRCUITPY_KEYPAD_DEMUX),1)
256-
SRC_PATTERNS += keypaddemux/%
256+
SRC_PATTERNS += keypad_demux/%
257257
endif
258258
ifeq ($(CIRCUITPY_LOCALE),1)
259259
SRC_PATTERNS += locale/%
@@ -744,8 +744,8 @@ endif
744744

745745
ifeq ($(CIRCUITPY_KEYPAD_DEMUX),1)
746746
SRC_SHARED_MODULE_ALL += \
747-
keypaddemux/__init__.c \
748-
keypaddemux/DemuxKeyMatrix.c
747+
keypad_demux/__init__.c \
748+
keypad_demux/DemuxKeyMatrix.c
749749
endif
750750

751751
# If supporting _bleio via HCI, make devices/ble_hci/common-hal/_bleio be includable,

shared-bindings/keypaddemux/DemuxKeyMatrix.c renamed to shared-bindings/keypad_demux/DemuxKeyMatrix.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "py/runtime.h"
3131
#include "shared-bindings/keypad/__init__.h"
3232
#include "shared-bindings/keypad/Event.h"
33-
#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h"
33+
#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h"
3434
#include "shared-bindings/microcontroller/Pin.h"
3535
#include "shared-bindings/util.h"
3636

@@ -43,7 +43,7 @@
4343
//| <details>
4444
//| <summary>Available on these boards</summary>
4545
//| <ul>
46-
//| {% for board in support_matrix_reverse["keypaddemux.DemuxKeyMatrix"] %}
46+
//| {% for board in support_matrix_reverse["keypad_demux.DemuxKeyMatrix"] %}
4747
//| <li> {{ board }}
4848
//| {% endfor %}
4949
//| </ul>
@@ -202,7 +202,6 @@ MP_DEFINE_CONST_FUN_OBJ_2(keypad_demux_demuxkeymatrix_key_number_to_row_column_o
202202
//| The key number is ``row * len(column_pins) + column``.
203203
//| """
204204
//| ...
205-
//|
206205
STATIC mp_obj_t keypad_demux_demuxkeymatrix_row_column_to_key_number(mp_obj_t self_in, mp_obj_t row_in, mp_obj_t column_in) {
207206
keypad_demux_demuxkeymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in);
208207
check_for_deinit(self);
@@ -218,6 +217,11 @@ STATIC mp_obj_t keypad_demux_demuxkeymatrix_row_column_to_key_number(mp_obj_t se
218217
}
219218
MP_DEFINE_CONST_FUN_OBJ_3(keypad_demux_demuxkeymatrix_row_column_to_key_number_obj, keypad_demux_demuxkeymatrix_row_column_to_key_number);
220219

220+
//| events: EventQueue
221+
//| """The `EventQueue` associated with this `keypad.Keys` object. (read-only)
222+
//| """
223+
//|
224+
221225
STATIC const mp_rom_map_elem_t keypad_demux_demuxkeymatrix_locals_dict_table[] = {
222226
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_demux_demuxkeymatrix_deinit_obj) },
223227
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },

shared-bindings/keypaddemux/DemuxKeyMatrix.h renamed to shared-bindings/keypad_demux/DemuxKeyMatrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_DEMUX_DEMUXKEYMATRIX_H
2929

3030
#include "py/objlist.h"
31-
#include "shared-module/keypaddemux/DemuxKeyMatrix.h"
31+
#include "shared-module/keypad_demux/DemuxKeyMatrix.h"
3232

3333
extern const mp_obj_type_t keypad_demux_demuxkeymatrix_type;
3434

shared-bindings/keypaddemux/__init__.c renamed to shared-bindings/keypad_demux/__init__.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626

2727
#include "py/obj.h"
2828

29-
#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h"
29+
#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h"
3030
#include "shared-bindings/util.h"
3131

3232
//| """Support for scanning key matrices that use a demultiplexer
3333
//|
34-
//| The `keypaddemux` module provides native support to scan sets of keys or buttons,
34+
//| The `keypad_demux` module provides native support to scan sets of keys or buttons,
3535
//| connected in a row-and-column matrix.
3636
//|
3737
//| .. jinja
3838
//| """
3939

4040
STATIC mp_rom_map_elem_t keypad_demux_module_globals_table[] = {
41-
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_keypaddemux) },
41+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_keypad_demux) },
4242
{ MP_ROM_QSTR(MP_QSTR_DemuxKeyMatrix), MP_OBJ_FROM_PTR(&keypad_demux_demuxkeymatrix_type) },
4343
};
4444

@@ -49,4 +49,4 @@ const mp_obj_module_t keypad_demux_module = {
4949
.globals = (mp_obj_dict_t *)&keypad_demux_module_globals,
5050
};
5151

52-
MP_REGISTER_MODULE(MP_QSTR_keypaddemux, keypad_demux_module);
52+
MP_REGISTER_MODULE(MP_QSTR_keypad_demux, keypad_demux_module);

shared-module/keypaddemux/DemuxKeyMatrix.c renamed to shared-module/keypad_demux/DemuxKeyMatrix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "py/runtime.h"
3131
#include "shared-bindings/digitalio/DigitalInOut.h"
3232
#include "shared-bindings/keypad/EventQueue.h"
33-
#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h"
33+
#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h"
3434
#include "shared-bindings/keypad/__init__.h"
3535
#include "shared-bindings/supervisor/__init__.h"
3636
#include "shared-bindings/util.h"

0 commit comments

Comments
 (0)