-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
c578422
commit a540ca9
Showing
47 changed files
with
2,680 additions
and
869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,7 @@ | |
#define XOSC_MHZ _u(12) | ||
#endif | ||
|
||
#define FIRST_USER_IRQ (NUM_IRQS - NUM_USER_IRQS) | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
add_library(pico_async_context_base INTERFACE) | ||
target_include_directories(pico_async_context_base INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) | ||
target_sources(pico_async_context_base INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/async_context_base.c | ||
) | ||
target_link_libraries(pico_async_context_base INTERFACE pico_platform) | ||
|
||
pico_add_impl_library(pico_async_context_poll INTERFACE) | ||
target_sources(pico_async_context_poll INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/async_context_poll.c | ||
) | ||
target_link_libraries(pico_async_context_poll INTERFACE pico_async_context_base) | ||
|
||
pico_add_impl_library(pico_async_context_threadsafe_background INTERFACE) | ||
target_sources(pico_async_context_threadsafe_background INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/async_context_threadsafe_background.c | ||
) | ||
target_link_libraries(pico_async_context_threadsafe_background INTERFACE pico_async_context_base) | ||
|
||
pico_add_impl_library(pico_async_context_freertos INTERFACE) | ||
target_sources(pico_async_context_freertos INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/async_context_freertos.c | ||
) | ||
target_link_libraries(pico_async_context_freertos INTERFACE pico_async_context_base) |
Oops, something went wrong.