Skip to content

Commit b81573d

Browse files
authored
Merge pull request #4891 from dhalbert/keypad-scanning-events
keypad: support for vector and matrix key scanning
2 parents ddf7160 + 36472a0 commit b81573d

File tree

52 files changed

+2604
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2604
-24
lines changed

locale/circuitpython.pot

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,22 @@ msgstr ""
8383
msgid "%q indices must be integers, not %s"
8484
msgstr ""
8585

86+
#: py/argcheck.c
87+
msgid "%q length must be %q"
88+
msgstr ""
89+
8690
#: shared-bindings/vectorio/Polygon.c
8791
msgid "%q list must be a list"
8892
msgstr ""
8993

94+
#: py/argcheck.c
95+
msgid "%q must <= %d"
96+
msgstr ""
97+
98+
#: py/argcheck.c
99+
msgid "%q must be %d-%d"
100+
msgstr ""
101+
90102
#: shared-bindings/usb_hid/Device.c
91103
msgid "%q must be 0-255"
92104
msgstr ""
@@ -95,7 +107,11 @@ msgstr ""
95107
msgid "%q must be 1-255"
96108
msgstr ""
97109

98-
#: shared-bindings/memorymonitor/AllocationAlarm.c
110+
#: py/argcheck.c
111+
msgid "%q must be >= %d"
112+
msgstr ""
113+
114+
#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c
99115
msgid "%q must be >= 0"
100116
msgstr ""
101117

@@ -111,6 +127,10 @@ msgstr ""
111127
msgid "%q must be None or between 1 and len(report_descriptor)-1"
112128
msgstr ""
113129

130+
#: py/argcheck.c
131+
msgid "%q must be a string"
132+
msgstr ""
133+
114134
#: shared-module/vectorio/Polygon.c
115135
msgid "%q must be a tuple of length 2"
116136
msgstr ""
@@ -119,6 +139,15 @@ msgstr ""
119139
msgid "%q must be between %d and %d"
120140
msgstr ""
121141

142+
#: py/argcheck.c
143+
msgid "%q must of type %q"
144+
msgstr ""
145+
146+
#: shared-bindings/keypad/KeyMatrix.c shared-bindings/keypad/Keys.c
147+
#: shared-bindings/keypad/ShiftRegisterKeys.c
148+
msgid "%q must store bytes"
149+
msgstr ""
150+
122151
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
123152
#: shared-bindings/canio/Match.c
124153
msgid "%q out of range"

main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
#include "shared-module/displayio/__init__.h"
8787
#endif
8888

89+
#if CIRCUITPY_KEYPAD
90+
#include "shared-module/keypad/__init__.h"
91+
#endif
92+
8993
#if CIRCUITPY_MEMORYMONITOR
9094
#include "shared-module/memorymonitor/__init__.h"
9195
#endif
@@ -230,9 +234,11 @@ STATIC void cleanup_after_vm(supervisor_allocation* heap) {
230234
#if CIRCUITPY_DISPLAYIO
231235
reset_displays();
232236
#endif
237+
233238
#if CIRCUITPY_MEMORYMONITOR
234239
memorymonitor_reset();
235240
#endif
241+
236242
filesystem_flush();
237243
stop_mp();
238244
free_memory(heap);
@@ -242,6 +248,10 @@ STATIC void cleanup_after_vm(supervisor_allocation* heap) {
242248
common_hal_canio_reset();
243249
#endif
244250

251+
#if CIRCUITPY_KEYPAD
252+
keypad_reset();
253+
#endif
254+
245255
// reset_board_busses() first because it may release pins from the never_reset state, so that
246256
// reset_port() can reset them.
247257
#if CIRCUITPY_BOARD

ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ LONGINT_IMPL = NONE
1414

1515
CIRCUITPY_BUSDEVICE = 1
1616
CIRCUITPY_DISPLAYIO = 0
17+
CIRCUITPY_KEYPAD = 0
1718

1819
# Include these Python libraries in firmware.
1920
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground

ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
1111

1212
# Turn off features and optimizations for displayio build to make room for additional frozen libs.
1313
LONGINT_IMPL = NONE
14+
CIRCUITPY_KEYPAD = 0
1415
CIRCUITPY_PIXELBUF = 0
1516
CIRCUITPY_ROTARYIO = 0
1617
CIRCUITPY_RTC = 0

ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ LONGINT_IMPL = NONE
1212

1313
# To keep the build small
1414
CIRCUITPY_AUDIOBUSIO = 0
15-
CIRCUITPY_GAMEPAD = 0
1615

1716
# Include these Python libraries in firmware.
1817
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH

ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CIRCUITPY_AUDIOMP3 = 0
1515
CIRCUITPY_BLEIO_HCI = 0
1616
CIRCUITPY_DISPLAYIO = 0
1717
CIRCUITPY_FRAMEBUFFERIO = 0
18+
CIRCUITPY_KEYPAD = 0
1819
CIRCUITPY_MSGPACK = 0
1920
CIRCUITPY_PS2IO = 0
2021
CIRCUITPY_RGBMATRIX = 0

ports/atmel-samd/boards/pycubed/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ CIRCUITPY_DRIVE_LABEL = "PYCUBED"
1616
CIRCUITPY_AUDIOBUSIO = 0
1717
CIRCUITPY_BITMAPTOOLS = 0
1818
CIRCUITPY_DISPLAYIO = 0
19+
CIRCUITPY_KEYPAD = 0
1920
CIRCUITPY_FRAMEBUFFERIO = 0
20-
CIRCUITPY_GAMEPAD = 0
2121
CIRCUITPY_RGBMATRIX = 0
2222
CIRCUITPY_PS2IO = 0
2323

ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CIRCUITPY_AUDIOBUSIO = 0
1717
CIRCUITPY_BITMAPTOOLS = 0
1818
CIRCUITPY_DISPLAYIO = 0
1919
CIRCUITPY_FRAMEBUFFERIO = 0
20-
CIRCUITPY_GAMEPAD = 0
20+
CIRCUITPY_KEYPAD = 0
2121
CIRCUITPY_RGBMATRIX = 0
2222
CIRCUITPY_PS2IO = 0
2323

ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ SPI_FLASH_FILESYSTEM = 1
1111
EXTERNAL_FLASH_DEVICES = AT25SF161
1212
LONGINT_IMPL = MPZ
1313

14+
CIRCUITPY_KEYPAD = 0
15+
1416
CIRCUITPY_BITBANG_APA102 = 1

ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ CIRCUITPY_FREQUENCYIO = 0
2222
CIRCUITPY_AUDIOBUSIO = 0
2323
CIRCUITPY_BLEIO = 0
2424
CIRCUITPY_DISPLAYIO = 0
25-
CIRCUITPY_GAMEPAD = 0
2625
CIRCUITPY_I2CPERIPHERAL = 0
2726
CIRCUITPY_TOUCHIO = 0
2827
CIRCUITPY_RGBMATRIX = 0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy