Commit de2efe0
committed
Fix cardputer boot loop, and do some cleanup.
- For `cardputer_keyboard.c`, allocate `DemuxKeyMatrix` it creates and the objects it holds (all the way down) on the port heap, because it lives past VM's.
- To do the above, add support for non-VM heap for `DemuxKeyMatrix` and the `keypad` allocations it needs by passing an arg `use_gc_allocator`, as is done in `lvfontio`.
- Add `mp_obj_port_malloc()`, `mp_obj_port_malloc_var()`, `mp_obj_new_port_tuple()`, all of which allocate on the port heap, not the VM heap.
- Add `port_malloc_zero()`, because `port_malloc()` did not zero out its allocation, unlike VM heap allocations. I got caught by this.
- Move `port_gc_collect()` from `main.c` to `supervisor/port.c` for consistency. This function is not actually used by anyone, but I was considering using it.
- Add an `MP_WEAK` `mp_board_init()`, for board-specific initializations needed when a VM starts. Also considered, but not used. Added anyway for possible future use.
- Add an `MP_WEAK` `board_gc_collect()`, for board-specific gc. Not used.
- Add an `MP_WEAK` `port_gc_collect()`, for port-specific gc. Not used.
- Don't duplicate keyboard code between `boards/m5stack_cardputer` and `boards/m5stack_cardputer_ros`. Instead, add a `ports/espressif/module` directory for this code, in the style of a port-specific `module` directory, like the port-specific `bindings` directories.1 parent 0707e28 commit de2efe0
File tree
23 files changed
+140
-509
lines changed- ports/espressif
- boards
- m5stack_cardputer_ros
- m5stack_cardputer
- module
- py
- supervisor
23 files changed
+140
-509
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| |||
1149 | 1152 | | |
1150 | 1153 | | |
1151 | 1154 | | |
| 1155 | + | |
1152 | 1156 | | |
1153 | 1157 | | |
1154 | 1158 | | |
| |||
1179 | 1183 | | |
1180 | 1184 | | |
1181 | 1185 | | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
Lines changed: 0 additions & 238 deletions
This file was deleted.
0 commit comments