Commit Graph

12 Commits

Author SHA1 Message Date
Jeff Epler
d7c86c0e3e
refactor keypad to share more code
This saves 444 bytes on the pygamer build (both commits taken together)

testing performed:
 * pygamer (samd51) with ShiftRegisterKeys
 * macropad (rp2040) with Keys
 * UM feather s2 (esp32-s2) with KeyMatrix

Result:
 * all ports still worked nicely
 * keys held down at start always registered (>2 trials all boards, >100 trials esp32-s2)
 * keys held down are immediately registered after reset() (>100 trials esp32-s2)
 * double .reset() is OK, accessing .events throws (only tested esp32-s2)
2022-04-05 14:50:30 -05:00
Timon
a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Dan Halbert
4f538b6c09 remove pressed() and get_states_into() 2021-06-23 15:10:38 -04:00
Dan Halbert
7774b18895 Add reset() to scanners. Clear .overflow on EventQueue.clear(). 2021-06-23 15:04:09 -04:00
Dan Halbert
acf90fbb43 many renamings; add overflowed flag to EventQuque 2021-06-23 09:57:15 -04:00
Dan Halbert
51c547a5b9 add generic arg validation routines; add interval args to keypad 2021-06-21 12:13:39 -04:00
Dan Halbert
a152bd3b72 add .num_keys and .store_states() to Keys and KeyMatrix 2021-06-17 12:02:54 -04:00
Dan Halbert
cd31136c30 factor out keypad.EventQueue 2021-06-16 15:55:54 -04:00
Dan Halbert
32eec85230 compiles 2021-06-14 20:54:43 -04:00
Dan Halbert
627c426259 wip 2021-06-14 16:00:15 -04:00
Dan Halbert
d3d9e0a487 add debouncing 2021-06-10 00:07:23 -04:00
Dan Halbert
7d23206018 Inital keypad work: Keys working: one pin per key
keypad.Buttons and keypad.State

Buttons -> Keys; further work

wip

wip

wip: compiles

about to try

keypad.Keys working
2021-06-08 20:27:31 -04:00