Skip to content

Commit

Permalink
Renamed module 'keypaddemux' in 'keypad_demux' and fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
CDarius committed Mar 19, 2024
1 parent f603377 commit bb683fa
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions py/circuitpy_defns.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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/%
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -43,7 +43,7 @@
//| <details>
//| <summary>Available on these boards</summary>
//| <ul>
//| {% for board in support_matrix_reverse["keypaddemux.DemuxKeyMatrix"] %}
//| {% for board in support_matrix_reverse["keypad_demux.DemuxKeyMatrix"] %}
//| <li> {{ board }}
//| {% endfor %}
//| </ul>
Expand Down Expand Up @@ -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);
Expand All @@ -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) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
};

Expand All @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit bb683fa

Please sign in to comment.