aboutsummaryrefslogtreecommitdiff
path: root/morningtown.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-03-02 22:57:42 +0100
committerThomas White <taw@physics.org>2023-03-02 22:57:42 +0100
commitfceab499c21eb01a7fafbeb1e6850dd021cbbcf2 (patch)
tree51a4997be5a1916679c8e7569c4b4eca716263c3 /morningtown.c
parentfcd95895036b22220f940f7bb38b049bd26534c0 (diff)
Use pico_cyw43_arch_lwip_poll
So little can be done in lwIP callbacks with the background driver, we end up polling anyway. So we might as well poll the driver directly, and be able to do more in the callbacks.
Diffstat (limited to 'morningtown.c')
-rw-r--r--morningtown.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/morningtown.c b/morningtown.c
index ed44aa3..42b7746 100644
--- a/morningtown.c
+++ b/morningtown.c
@@ -152,7 +152,7 @@ int main()
rtc_init();
ntp_state = ntp_init(ntp_callback);
- last_conn = 10;
+ last_conn = 200;
while (1) {
watchdog_update();
@@ -176,19 +176,15 @@ int main()
}
if ( ntp_ok ) {
- debug_print("connected OK. Checking clock..\n");
check_clock();
}
- ntp_poll(ntp_state);
-
if ( ntp_ok && !gpio_get(TEST_BUTTON) ) {
gpio_put(LED_GREEN, 1);
}
- debug_print("tick\n");
-
last_conn += 1;
+ cyw43_arch_poll();
sleep_ms(100);
}