Add new async_context abstraction and refactor cyw43_arch to use it (#1177)

* Extract all poll/threadsafe_background/freertos from cyw43_arch into new abstraction async_context:
* provides support for asynchronous events (timers/IRQ notifications) to be handled in a safe context.
* now guarantees all callbacks happen on a single core.
* is reusable by multiple different libraries (stdio_usb can now be ported to this but hasn't been yet).
* supports multiple independent instances (independent instances will not block each other).
* cyw43_arch libraries cleaned up to use the new abstraction. Note each distinct cyw43_arch type is now a very thin layer that creates the right type of context and adds cyw43_driver and lwip support as appropriate.

Additionally,

* Add new pico_time and hardware_alarm APIs
* Add from_us_since_boot()
* Add alarm_pool_create_with_unused_hardware_alarm()
* Add alarm_pool_add_alarm_at_force_in_context()
* Add hardware_alarm_claim_unused()
* Add hardware_alarm_force_irq()
* Added panic_compact() and some minor comment cleanup; moved FIRST_USER_IRQ define to platform_defs.h
This commit is contained in:
Graham Sanderson
2023-01-24 12:01:24 -06:00
committed by GitHub
parent c578422528
commit a540ca905a
47 changed files with 2694 additions and 883 deletions

View File

@ -41,6 +41,7 @@
* This group of libraries provide higher level functionality that isn't hardware related or provides a richer
* set of functionality above the basic hardware interfaces
* @{
* \defgroup pico_async_context pico_async_context
* \defgroup pico_multicore pico_multicore
* \defgroup pico_stdlib pico_stdlib
* \defgroup pico_sync pico_sync
@ -59,6 +60,7 @@
* \defgroup networking Networking Libraries
* Functions for implementing networking
* @{
* \defgroup pico_cyw43_driver pico_cyw43_driver
* \defgroup pico_lwip pico_lwip
* \defgroup pico_cyw43_arch pico_cyw43_arch
* @}