log via usb
This commit is contained in:
parent
cecf2d079e
commit
4bd1d6f368
@ -34,11 +34,14 @@ project(blink C CXX ASM)
|
|||||||
pico_sdk_init()
|
pico_sdk_init()
|
||||||
|
|
||||||
# Add executable. Default name is the project name, version 0.1
|
# Add executable. Default name is the project name, version 0.1
|
||||||
|
|
||||||
add_executable(blink
|
add_executable(blink
|
||||||
blink.c
|
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)
|
add_library(zig_library STATIC IMPORTED)
|
||||||
set_property(TARGET zig_library PROPERTY IMPORTED_LOCATION ../zig-out/lib/libpicow_zig.a)
|
set_property(TARGET zig_library PROPERTY IMPORTED_LOCATION ../zig-out/lib/libpicow_zig.a)
|
||||||
|
|
||||||
|
13
blink.c
13
blink.c
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
#include <pico/time.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -47,8 +48,18 @@ extern int32_t add(int32_t a, int32_t b);
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
stdio_init_all();
|
stdio_init_all();
|
||||||
|
|
||||||
|
// 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));
|
printf("result from zig : %d\n", add(10, 31));
|
||||||
return 0;
|
sleep_ms(1000);
|
||||||
|
}
|
||||||
|
|
||||||
// int rc = pico_led_init();
|
// int rc = pico_led_init();
|
||||||
// hard_assert(rc == PICO_OK);
|
// hard_assert(rc == PICO_OK);
|
||||||
// while (true) {
|
// while (true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user