Commit f201295f by ishikawatatsuki

Adding cyw43_arch for pico W

parent bcb56041
...@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.13) ...@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(PICO_BOARD pico_w)
# initalize pico_sdk from installed location # initalize pico_sdk from installed location
# (note this can come from environment, CMake cache etc) # (note this can come from environment, CMake cache etc)
...@@ -31,7 +32,7 @@ pico_enable_stdio_uart(main 1) ...@@ -31,7 +32,7 @@ pico_enable_stdio_uart(main 1)
pico_enable_stdio_usb(main 1) pico_enable_stdio_usb(main 1)
# Add the standard library to the build # Add the standard library to the build
target_link_libraries(main pico_stdlib) target_link_libraries(main pico_stdlib pico_cyw43_arch_none)
pico_add_extra_outputs(main) pico_add_extra_outputs(main)
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include "pico/stdlib.h" #include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include "includes/AnyLib.h" #include "includes/AnyLib.h"
const uint LED_PIN = 25;
void task1() void task1()
{ {
MathBasics mb; MathBasics mb;
...@@ -17,12 +16,15 @@ void task1() ...@@ -17,12 +16,15 @@ void task1()
int main() int main()
{ {
stdio_init_all(); stdio_init_all();
gpio_init(LED_PIN); // Initialize the system and Wi-Fi chip (which includes the onboard LED control)
gpio_set_dir(LED_PIN,GPIO_OUT); if (cyw43_arch_init()) {
// Failed to initialize
return -1;
}
bool value =0; bool value =0;
while (true) while (true)
{ {
gpio_put(LED_PIN,value); cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, value);
sleep_ms(500); sleep_ms(500);
value =!value; value =!value;
printf("LED toggle\n"); printf("LED toggle\n");
......
BIN = lab0 BIN = lab0
CC = g++ CC = g++
SRC = lab0.cpp AnyLib.cpp SRC = lab0.cpp AnyLib.cpp ../../lib/src/NeuralNetwork.cpp
all: $(BIN) all: $(BIN)
$(BIN): $(SRC) $(BIN): $(SRC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment