diff --git a/CMakeLists.txt b/CMakeLists.txt index dc05700..cf593e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,11 +34,14 @@ project(blink C CXX ASM) pico_sdk_init() # Add executable. Default name is the project name, version 0.1 - add_executable(blink blink.c ) +# Modify the below lines to enable/disable output over UART/USB +pico_enable_stdio_uart(blink 0) +pico_enable_stdio_usb(blink 1) + add_library(zig_library STATIC IMPORTED) set_property(TARGET zig_library PROPERTY IMPORTED_LOCATION ../zig-out/lib/libpicow_zig.a) diff --git a/blink.c b/blink.c index 0bc59d6..ed9fd63 100644 --- a/blink.c +++ b/blink.c @@ -5,6 +5,7 @@ */ #include "pico/stdlib.h" +#include #include #include @@ -47,8 +48,18 @@ extern int32_t add(int32_t a, int32_t b); int main() { stdio_init_all(); - printf("result from zig : %d\n", add(10, 31)); - return 0; + + // Initialise the Wi-Fi chip + if (cyw43_arch_init()) { + printf("Wi-Fi init failed\n"); + return -1; + } + + while (true) { + printf("result from zig : %d\n", add(10, 31)); + sleep_ms(1000); + } + // int rc = pico_led_init(); // hard_assert(rc == PICO_OK); // while (true) {