We started replacing Contiki with a similar but simpler event loop in pbio/os recently. A few drivers are still to be done.
Most of these are very straightforward. It is just replacing the macros, return values, and polls.
pbio/task and Bluetooth probably deserves a closer look. I think we could aim to translate it as-is at first, and then consider if we could make any improvements. The new pbio_os_process_t structure is nearly identical to that of pbio/tasks. They're just used slightly differently: queued instead of all running in parallel.
We do need to add a cancellation request but we need to add that anyway to implement a process exit method, which is currently used to reset the Bluetooth process from pbdrv_bluetooth_power_on(false).
It would be nice to integrate this properly instead of letting the Bluetooth processes being the odd one out as they are today.
Completing this should bring back some consistency for us and new contributors.
It should also free up a couple of hundred bytes since we would no longer need the etimer process. It will also free up some space in processes that have a lot of status = err; exit(pt) since this is now a simple return err.
We started replacing Contiki with a similar but simpler event loop in pbio/os recently. A few drivers are still to be done.
Most of these are very straightforward. It is just replacing the macros, return values, and polls.
pbio/task and Bluetooth probably deserves a closer look. I think we could aim to translate it as-is at first, and then consider if we could make any improvements. The new
pbio_os_process_tstructure is nearly identical to that ofpbio/tasks. They're just used slightly differently: queued instead of all running in parallel.We do need to add a cancellation request but we need to add that anyway to implement a process exit method, which is currently used to reset the Bluetooth process from
pbdrv_bluetooth_power_on(false).It would be nice to integrate this properly instead of letting the Bluetooth processes being the odd one out as they are today.
Completing this should bring back some consistency for us and new contributors.
It should also free up a couple of hundred bytes since we would no longer need the
etimerprocess. It will also free up some space in processes that have a lot ofstatus = err; exit(pt)since this is now a simplereturn err.