From bb683fa4cfaab6add5ca53819fcb9077cebd82f4 Mon Sep 17 00:00:00 2001 From: CDarius Date: Tue, 19 Mar 2024 09:59:02 +0100 Subject: [PATCH] Renamed module 'keypaddemux' in 'keypad_demux' and fix documentation --- docs/shared_bindings_matrix.py | 2 +- py/circuitpy_defns.mk | 6 +++--- .../{keypaddemux => keypad_demux}/DemuxKeyMatrix.c | 10 +++++++--- .../{keypaddemux => keypad_demux}/DemuxKeyMatrix.h | 2 +- .../{keypaddemux => keypad_demux}/__init__.c | 8 ++++---- .../{keypaddemux => keypad_demux}/DemuxKeyMatrix.c | 2 +- .../{keypaddemux => keypad_demux}/DemuxKeyMatrix.h | 0 shared-module/{keypaddemux => keypad_demux}/__init__.c | 0 8 files changed, 17 insertions(+), 13 deletions(-) rename shared-bindings/{keypaddemux => keypad_demux}/DemuxKeyMatrix.c (97%) rename shared-bindings/{keypaddemux => keypad_demux}/DemuxKeyMatrix.h (97%) rename shared-bindings/{keypaddemux => keypad_demux}/__init__.c (89%) rename shared-module/{keypaddemux => keypad_demux}/DemuxKeyMatrix.c (99%) rename shared-module/{keypaddemux => keypad_demux}/DemuxKeyMatrix.h (100%) rename shared-module/{keypaddemux => keypad_demux}/__init__.c (100%) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index b5cbc62aa6e4..47a0098a4d7a 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -78,7 +78,7 @@ "keypad.KeyMatrix": "CIRCUITPY_KEYPAD_KEYMATRIX", "keypad.Keys": "CIRCUITPY_KEYPAD_KEYS", "keypad.ShiftRegisterKeys": "CIRCUITPY_KEYPAD_SHIFTREGISTERKEYS", - "keypaddemux.DemuxKeyMatrix": "CIRCUITPY_KEYPAD_DEMUX", + "keypad_demux.DemuxKeyMatrix": "CIRCUITPY_KEYPAD_DEMUX", "os.getenv": "CIRCUITPY_OS_GETENV", "select": "MICROPY_PY_SELECT_SELECT", "sys": "CIRCUITPY_SYS", diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 67d91f3b1668..e83baae68f5b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -253,7 +253,7 @@ ifeq ($(CIRCUITPY_KEYPAD),1) SRC_PATTERNS += keypad/% endif ifeq ($(CIRCUITPY_KEYPAD_DEMUX),1) -SRC_PATTERNS += keypaddemux/% +SRC_PATTERNS += keypad_demux/% endif ifeq ($(CIRCUITPY_LOCALE),1) SRC_PATTERNS += locale/% @@ -744,8 +744,8 @@ endif ifeq ($(CIRCUITPY_KEYPAD_DEMUX),1) SRC_SHARED_MODULE_ALL += \ - keypaddemux/__init__.c \ - keypaddemux/DemuxKeyMatrix.c + keypad_demux/__init__.c \ + keypad_demux/DemuxKeyMatrix.c endif # If supporting _bleio via HCI, make devices/ble_hci/common-hal/_bleio be includable, diff --git a/shared-bindings/keypaddemux/DemuxKeyMatrix.c b/shared-bindings/keypad_demux/DemuxKeyMatrix.c similarity index 97% rename from shared-bindings/keypaddemux/DemuxKeyMatrix.c rename to shared-bindings/keypad_demux/DemuxKeyMatrix.c index cf0e8c65839f..6eaa8aaab2f2 100644 --- a/shared-bindings/keypaddemux/DemuxKeyMatrix.c +++ b/shared-bindings/keypad_demux/DemuxKeyMatrix.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" -#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h" +#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" @@ -43,7 +43,7 @@ //|
//| Available on these boards //| @@ -202,7 +202,6 @@ MP_DEFINE_CONST_FUN_OBJ_2(keypad_demux_demuxkeymatrix_key_number_to_row_column_o //| The key number is ``row * len(column_pins) + column``. //| """ //| ... -//| 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) { keypad_demux_demuxkeymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -218,6 +217,11 @@ STATIC mp_obj_t keypad_demux_demuxkeymatrix_row_column_to_key_number(mp_obj_t se } MP_DEFINE_CONST_FUN_OBJ_3(keypad_demux_demuxkeymatrix_row_column_to_key_number_obj, keypad_demux_demuxkeymatrix_row_column_to_key_number); +//| events: EventQueue +//| """The `EventQueue` associated with this `keypad.Keys` object. (read-only) +//| """ +//| + STATIC const mp_rom_map_elem_t keypad_demux_demuxkeymatrix_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_demux_demuxkeymatrix_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, diff --git a/shared-bindings/keypaddemux/DemuxKeyMatrix.h b/shared-bindings/keypad_demux/DemuxKeyMatrix.h similarity index 97% rename from shared-bindings/keypaddemux/DemuxKeyMatrix.h rename to shared-bindings/keypad_demux/DemuxKeyMatrix.h index fc45a39d78b6..caa54bb4c67a 100644 --- a/shared-bindings/keypaddemux/DemuxKeyMatrix.h +++ b/shared-bindings/keypad_demux/DemuxKeyMatrix.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_DEMUX_DEMUXKEYMATRIX_H #include "py/objlist.h" -#include "shared-module/keypaddemux/DemuxKeyMatrix.h" +#include "shared-module/keypad_demux/DemuxKeyMatrix.h" extern const mp_obj_type_t keypad_demux_demuxkeymatrix_type; diff --git a/shared-bindings/keypaddemux/__init__.c b/shared-bindings/keypad_demux/__init__.c similarity index 89% rename from shared-bindings/keypaddemux/__init__.c rename to shared-bindings/keypad_demux/__init__.c index c0c83a60cb05..fdce618e6401 100644 --- a/shared-bindings/keypaddemux/__init__.c +++ b/shared-bindings/keypad_demux/__init__.c @@ -26,19 +26,19 @@ #include "py/obj.h" -#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h" +#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h" #include "shared-bindings/util.h" //| """Support for scanning key matrices that use a demultiplexer //| -//| The `keypaddemux` module provides native support to scan sets of keys or buttons, +//| The `keypad_demux` module provides native support to scan sets of keys or buttons, //| connected in a row-and-column matrix. //| //| .. jinja //| """ STATIC mp_rom_map_elem_t keypad_demux_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_keypaddemux) }, + { MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_keypad_demux) }, { MP_ROM_QSTR(MP_QSTR_DemuxKeyMatrix), MP_OBJ_FROM_PTR(&keypad_demux_demuxkeymatrix_type) }, }; @@ -49,4 +49,4 @@ const mp_obj_module_t keypad_demux_module = { .globals = (mp_obj_dict_t *)&keypad_demux_module_globals, }; -MP_REGISTER_MODULE(MP_QSTR_keypaddemux, keypad_demux_module); +MP_REGISTER_MODULE(MP_QSTR_keypad_demux, keypad_demux_module); diff --git a/shared-module/keypaddemux/DemuxKeyMatrix.c b/shared-module/keypad_demux/DemuxKeyMatrix.c similarity index 99% rename from shared-module/keypaddemux/DemuxKeyMatrix.c rename to shared-module/keypad_demux/DemuxKeyMatrix.c index a343c6301d32..816616f06d6f 100644 --- a/shared-module/keypaddemux/DemuxKeyMatrix.c +++ b/shared-module/keypad_demux/DemuxKeyMatrix.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/keypad/EventQueue.h" -#include "shared-bindings/keypaddemux/DemuxKeyMatrix.h" +#include "shared-bindings/keypad_demux/DemuxKeyMatrix.h" #include "shared-bindings/keypad/__init__.h" #include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/util.h" diff --git a/shared-module/keypaddemux/DemuxKeyMatrix.h b/shared-module/keypad_demux/DemuxKeyMatrix.h similarity index 100% rename from shared-module/keypaddemux/DemuxKeyMatrix.h rename to shared-module/keypad_demux/DemuxKeyMatrix.h diff --git a/shared-module/keypaddemux/__init__.c b/shared-module/keypad_demux/__init__.c similarity index 100% rename from shared-module/keypaddemux/__init__.c rename to shared-module/keypad_demux/__init__.c