File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -375,12 +375,18 @@ int main(void) {
375375 // We are not in a callback but we can get away with calling mqtt_client_is_connected()
376376 // because it's a read-only operation
377377 while (!state .connect_done || mqtt_client_is_connected (state .mqtt_client_inst )) {
378- // As supplied the example configures cyw43_arch for thread_safe_background operation
379- // by linking `pico_cyw43_arch_lwip_threadsafe_background` in CMakeLists.txt, so the
380- // following two lines are unnecessary (but do no harm). However you will need them
381- // if you reconfigure the build to use cyw43_arch in polling mode.
378+
379+ #ifdef PICO_CYW43_ARCH_POLL
380+ // if you use cyw43_arch in lwip_poll mode then you must periodically call
381+ // cyw43_arch_poll() from your main loop (see SDK network API documentaion)
382382 cyw43_arch_poll ();
383383 cyw43_arch_wait_for_work_until (make_timeout_time_ms (10000 ));
384+ #else
385+ // as supplied the example configures cyw43_arch for thread_safe_background
386+ // operation (see CMakeLists.txt) so there's no need to poll
387+ sleep_ms (10000 );
388+ #endif
389+
384390 }
385391
386392 INFO_printf ("mqtt client exiting\n" );
You can’t perform that action at this time.
0 commit comments