aboutsummaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-04-25 15:54:24 +0200
committerlonkaars <loek@pipeframe.xyz>2024-04-25 15:54:24 +0200
commit6df58f546db68047fe38f3809ee4f6cbff4c6f89 (patch)
tree8964f9bdc736e301dad7c11b24c03b2891e3916f /main/main.cpp
parent42b3b8abd73d0f38efd607fc9dfcf768341549a1 (diff)
clean up init
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 8b3504c..d85c76e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1,13 +1,10 @@
-#include "config.h"
-
#include <FreeRTOS.h>
#include <task.h>
#include <pico/stdlib.h>
-#include <pico/stdio.h>
-#include <pico/cyw43_arch.h>
-const unsigned int LED_PIN = CYW43_WL_GPIO_LED_PIN;
+#include "config.h"
+#include "init.h"
void blink_task() {
while (true) {
@@ -19,25 +16,7 @@ void blink_task() {
}
int main() {
- stdio_init_all();
- sleep_ms(2000);
-
- if (cyw43_arch_init_with_country(CONF_NET_COUNTRY)) {
- printf("failed to initialize\n");
- return 1;
- }
- cyw43_arch_gpio_put(LED_PIN, 1);
-
-
- printf("initialised\n");
-
- cyw43_arch_enable_sta_mode();
-
- if (cyw43_arch_wifi_connect_timeout_ms(CONF_NET_SSID, CONF_NET_PASS, CYW43_AUTH_WPA2_AES_PSK, 10000)) {
- printf("failed to connect\n");
- return 1;
- }
- printf("connected\n");
+ init();
xTaskCreate((TaskFunction_t) blink_task, "blink", 128, NULL, 1, NULL);
vTaskStartScheduler();