rp2/mpnetworkport: Refactor out cyw43_has_pending global variable.

A better indication of whether a cyw43 event is pending is the actual flag
in the PendSV handler table. (If this fails, could also use the GPIO
interrupt enabled register bit).

This commit was needed of a previous version of the fix in the parent
commit, but it turned out not strictly necessary for the current version.
However, it's still a good clean up.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2025-03-18 16:05:41 +11:00
committed by Damien George
parent 6fa498cba1
commit 23fb171b80
5 changed files with 11 additions and 7 deletions

View File

@@ -140,10 +140,12 @@ uint cyw43_get_pin_wl(cyw43_pin_index_t pin_id);
#endif
void cyw43_post_poll_hook(void);
extern volatile int cyw43_has_pending;
static inline bool cyw43_poll_is_pending(void) {
return pendsv_is_pending(PENDSV_DISPATCH_CYW43);
}
static inline void cyw43_yield(void) {
if (!cyw43_has_pending) {
if (!cyw43_poll_is_pending()) {
best_effort_wfe_or_timeout(make_timeout_time_ms(1));
}
}