Pico Led Controller 1.0.3
A project to control LEDs using Raspberry Pi Pico W
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1#include "led_controller.h"
2
3extern volatile bool stop_flag;
4
5int main()
6{
7 enum init_result_t init_result = init();
8 if (init_result != INIT_SUCCESS)
9 return init_result;
10 multicore_launch_core1(run_loop);
11 while (true)
12 {
13 int wifi_link_status = cyw43_wifi_link_status(&cyw43_state, CYW43_ITF_STA);
14 if (wifi_link_status != CYW43_LINK_UP && wifi_link_status != CYW43_LINK_JOIN && !stop_flag)
15 {
16 printf("Wi-Fi link status: %d\n", wifi_link_status);
19 }
20 if (stop_flag)
21 break;
22 sleep_ms(25000);
23 }
24 printf("Stopping...\n");
26 cyw43_arch_deinit();
27 ntp_deinit();
28 return 0;
29}
init_result_t
Init result enum.
@ INIT_SUCCESS
void connect_to_wifi()
Connect to WiFi.
void run_loop()
Run loop.
enum init_result_t init()
Init.
volatile bool stop_flag
int main()
Definition main.c:5
void ntp_deinit(void)
NTP deinit.
Definition ntp.c:114