Port Soft-AP web UI and LED engine onto Pico 2 W C firmware.
Serve the ESP32 frontend over httpserver/WebSocket, drive eight WS2812 strips with PIO/DMA patterns on core1, and keep Wi-Fi control on core0. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b783d97f13
commit
b3e9fc9663
28 files changed
+5123
-14
No files matched your search
+14
-13
@@ -1,35 +1,36 @@
|
||||
#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/stdlib.h"
|
||||
#include "pico/multicore.h"
|
||||
#include "pico/cyw43_arch.h"
|
||||
|
||||
#include "ap.h"
|
||||
#include "web.h"
|
||||
#include "led_core.h"
|
||||
|
||||
int main() {
|
||||
stdio_init_all();
|
||||
sleep_ms(200);
|
||||
|
||||
while (cyw43_arch_init()) {
|
||||
if (stdio_usb_connected()) {
|
||||
printf("cyw43_arch_init failed; retrying...\n");
|
||||
}
|
||||
printf("cyw43_arch_init failed; retrying...\n");
|
||||
sleep_ms(1000);
|
||||
}
|
||||
|
||||
printf("LED blink example starting\n");
|
||||
printf("led_hoop: Soft-AP + web + LEDs\n");
|
||||
|
||||
unsigned int count = 0;
|
||||
multicore_launch_core1(led_core_entry);
|
||||
|
||||
ap_start();
|
||||
web_start();
|
||||
|
||||
unsigned count = 0;
|
||||
while (true) {
|
||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
|
||||
if (stdio_usb_connected() || count % 10 == 0) {
|
||||
printf("count=%u\n", count);
|
||||
/* Keep core0 responsive for cyw43 background; light status print */
|
||||
if (count % 20 == 0) {
|
||||
printf("core0 alive 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