File tree Expand file tree Collapse file tree 5 files changed +14
-22
lines changed
Expand file tree Collapse file tree 5 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,9 @@ void port_background_tick(void) {
3636 #endif
3737}
3838
39- // Allow boards to override this.
40- MP_WEAK void board_background_task (void ) {
41- }
42-
4339void port_background_task (void ) {
44- board_background_task ();
40+ // Make sure time advances in the simulator.
41+ #if defined(CONFIG_ARCH_POSIX )
42+ k_busy_wait (100 );
43+ #endif
4544}
Original file line number Diff line number Diff line change 1313#include "py/mpconfig.h"
1414#include "supervisor/shared/tick.h"
1515
16+ #include <zephyr/kernel.h>
17+
1618#define mp_hal_ticks_ms () ((mp_uint_t)supervisor_ticks_ms32())
17- #define mp_hal_delay_us (us ) NRFX_DELAY_US((uint32_t)(us))
19+
20+ static inline void mp_hal_delay_us (mp_uint_t us ) {
21+ k_busy_wait ((uint32_t )us );
22+ }
1823
1924bool mp_hal_stdin_any (void );
Original file line number Diff line number Diff line change @@ -67,10 +67,6 @@ void port_wake_main_task_from_isr(void) {
6767
6868void port_yield (void ) {
6969 k_yield ();
70- // Make sure time advances in the simulator.
71- #if defined(CONFIG_ARCH_POSIX )
72- k_busy_wait (100 );
73- #endif
7470}
7571
7672void port_boot_info (void ) {
@@ -97,6 +93,10 @@ uint32_t port_get_saved_word(void) {
9793}
9894
9995uint64_t port_get_raw_ticks (uint8_t * subticks ) {
96+ // Make sure time advances in the simulator.
97+ #if defined(CONFIG_ARCH_POSIX )
98+ k_busy_wait (100 );
99+ #endif
100100 int64_t uptime = k_uptime_ticks () * 32768 / CONFIG_SYS_CLOCK_TICKS_PER_SEC ;
101101 if (subticks != NULL ) {
102102 * subticks = uptime % 32 ;
Original file line number Diff line number Diff line change @@ -61,10 +61,6 @@ static int background_prevention_count;
6161void PLACE_IN_ITCM (background_callback_run_all )(void ) {
6262 port_background_task ();
6363 if (!background_callback_pending ()) {
64- // TEMPORARY to fix #10822
65- #ifdef __ZEPHYR__
66- port_yield ();
67- #endif
6864 return ;
6965 }
7066 CALLBACK_CRITICAL_BEGIN ;
@@ -91,10 +87,6 @@ void PLACE_IN_ITCM(background_callback_run_all)(void) {
9187 }
9288 -- background_prevention_count ;
9389 CALLBACK_CRITICAL_END ;
94- // TEMPORARY to fix #10822
95- #ifdef __ZEPHYR__
96- port_yield ();
97- #endif
9890}
9991
10092void background_callback_prevent (void ) {
Original file line number Diff line number Diff line change @@ -82,10 +82,6 @@ safe_mode_t wait_for_safe_mode_reset(void) {
8282 boot_in_safe_mode = true;
8383 break ;
8484 }
85- // TEMPORARY to fix #10822
86- #ifdef __ZEPHYR__
87- port_yield ();
88- #endif
8985 diff = supervisor_ticks_ms64 () - start_ticks ;
9086 }
9187 #if CIRCUITPY_STATUS_LED
You can’t perform that action at this time.
0 commit comments