Commit Graph

20 Commits

Author SHA1 Message Date
Dan Halbert
fe0e2f13bc wip; fix qstr processing 2023-08-10 20:06:32 -04:00
Dan Halbert
0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
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
Jeff Epler
203dad11bf
keypad: scan immediately on construct, .reset() 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
Jeff Epler
72bfd39a17 keypad: Event: add timestamp.
this will probably need simplification before it fits on constrained
boards.
2021-09-16 21:08:05 -05:00
Dan Halbert
2451c788f4 valid channels in audio_dma_stop; cleaner supervisor_ticks mgmt in keypad 2021-08-09 09:47:13 -04: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
3d18c5c327 Use a single list of keypad scanners 2021-06-16 13:29:38 -04:00
Dan Halbert
350652ee21 Keys works; more testing to do 2021-06-14 22:59:17 -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
01a8a95b2c fix signed/unsigned compilation problem 2021-06-10 01:14:16 -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