Open laurensvalk opened 2 months ago
We'll also want to tell Pybricks Code the maximum available size for the current slot, since it is no longer the fixed size we provide in the hub capabilities.
Gathering some notes from elsewhere in one place:
At minimum, we'll also want to do the following:
- [ ] Introduce a status flag such as
PBIO_PYBRICKS_STATUS_RECEIVING_PROGRAM
to prevent the UI interactions like a slot change while a big program is being loaded. This isn't done yet, so changing slot while loading lead to failure.- [ ] Inform Pybricks Code about the maximum size for the current slot, or all slots. Perhaps also include the slot in the event status report (slot is not necessarily the same as program ID). Right now, Pybricks Code won't know that storage is full until it is actually full.
We can probably rethink the logic for downloading programs more generally. At the moment, Pybricks Code sets the program size to 0 (to prevent it from being run), then uploads the program, then downloads the size. This is no longer sufficient, hence the need for a status. Alternately, maybe this should be a process of some kind so the hub can know about failure (and clear that status). Right now, if uploading stops halfway the hub has no way of knowing since it doesn't know the final file size.
Originally posted by @laurensvalk in https://github.com/pybricks/pybricks-micropython/pull/266
I would much prefer to see slots saved to external flash when not in use rather than trying to keep all slots in RAM at the same time. Otherwise, we are wasting a lot of RAM.
Originally posted by @dlech in https://github.com/pybricks/pybricks-micropython/pull/266
Originally posted by @dlech in https://github.com/pybricks/pybricks-micropython/pull/264