Add Pico 2 W C firmware with Soft-AP and LED blink.
Bring up a minimal cyw43 Soft-AP (powersave disabled) plus USB serial blink example, with Makefile flash/monitor helpers and build ignore. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
47c17dba36
commit
b783d97f13
10 files changed
+699
-1
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
// Minimal example: initialize cyw43 and blink its onboard LED.
|
||||
// (On `pico2_w` the LED lives on the wireless chip, not the main RP pin.)
|
||||
#include "pico/cyw43_arch.h"
|
||||
#include "ap.h"
|
||||
|
||||
int main() {
|
||||
stdio_init_all();
|
||||
sleep_ms(200);
|
||||
|
||||
while (cyw43_arch_init()) {
|
||||
if (stdio_usb_connected()) {
|
||||
printf("cyw43_arch_init failed; retrying...\n");
|
||||
}
|
||||
sleep_ms(1000);
|
||||
}
|
||||
|
||||
printf("LED blink example starting\n");
|
||||
|
||||
unsigned int count = 0;
|
||||
|
||||
ap_start();
|
||||
while (true) {
|
||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
|
||||
if (stdio_usb_connected() || count % 10 == 0) {
|
||||
printf("count=%u\n", count);
|
||||
}
|
||||
count++;
|
||||
sleep_ms(500);
|
||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
|
||||
sleep_ms(500);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user