@geastack/targets 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +83 -0
- package/package.json +50 -0
- package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
- package/targets/cmake/geatsc_generated_archive.cmake +116 -0
- package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
- package/targets/esp32/app_project.cmake +33 -0
- package/targets/esp32/apps/app_manager.cpp +188 -0
- package/targets/esp32/apps/app_manager.h +10 -0
- package/targets/esp32/chip_bindings/README.md +58 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
- package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
- package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
- package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
- package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
- package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
- package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
- package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
- package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
- package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
- package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
- package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
- package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
- package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
- package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
- package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
- package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
- package/targets/esp32/connectivity/ble_hid.h +8 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
- package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
- package/targets/esp32/connectivity/wifi.cpp +615 -0
- package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
- package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
- package/targets/esp32/display.cpp +6010 -0
- package/targets/esp32/display_headless.cpp +468 -0
- package/targets/esp32/gea/platform_random.h +11 -0
- package/targets/esp32/gea_framework.cmake +382 -0
- package/targets/esp32/gpio.cpp +229 -0
- package/targets/esp32/host_sources.cmake +35 -0
- package/targets/esp32/imu_absent.cpp +36 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
- package/targets/esp32/memory_config.h +64 -0
- package/targets/esp32/power_absent.cpp +22 -0
- package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
- package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
- package/targets/esp32/sdk-patches/README.md +127 -0
- package/targets/esp32/services/app_runner.cpp +248 -0
- package/targets/esp32/services/app_state.cpp +56 -0
- package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
- package/targets/esp32/services/battery_service.cpp +31 -0
- package/targets/esp32/services/device_control.cpp +1896 -0
- package/targets/esp32/services/device_control.h +31 -0
- package/targets/esp32/services/frame_scheduler.cpp +1571 -0
- package/targets/esp32/services/heap.cpp +129 -0
- package/targets/esp32/services/memory.cpp +103 -0
- package/targets/esp32/services/ota.cpp +840 -0
- package/targets/esp32/services/ota_image.cpp +162 -0
- package/targets/esp32/services/ota_image.h +16 -0
- package/targets/esp32/services/storage_service.cpp +159 -0
- package/targets/esp32/touch_absent.cpp +44 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
- package/targets/esp32-m5stack-m5paper/README.md +55 -0
- package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
- package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
- package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
- package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
- package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
- package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
- package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
- package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
- package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
- package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
- package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
- package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
- package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
- package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
- package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
- package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
- package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
- package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
- package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
- package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
- package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
- package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
- package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
- package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
- package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
- package/targets/esp32-s3-devkit-n16r8.json +31 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
- package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
- package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
- package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
- package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
- package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
- package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
- package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
- package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
- package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
- package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
- package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
- package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
- package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
- package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
- package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
- package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
- package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
- package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
- package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
- package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
- package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
- package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
- package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
- package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
- package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
- package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
- package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
- package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
- package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
- package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
- package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
- package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
- package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
- package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
- package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
- package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
- package/targets/rp2350-tufty-2350/README.md +53 -0
- package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
- package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
- package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
- package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
- package/targets.json +154 -0
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
#include "wifi.h"
|
|
2
|
+
|
|
3
|
+
#if __has_include("wifi_config.h")
|
|
4
|
+
#include "wifi_config.h"
|
|
5
|
+
#endif
|
|
6
|
+
#if __has_include("gea_embedded_app_config.h")
|
|
7
|
+
#include "gea_embedded_app_config.h"
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#ifndef GEA_EMBEDDED_WIFI_SSID
|
|
11
|
+
#define GEA_EMBEDDED_WIFI_SSID ""
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#ifndef GEA_EMBEDDED_WIFI_PASSWORD
|
|
15
|
+
#define GEA_EMBEDDED_WIFI_PASSWORD ""
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#include <cstddef>
|
|
19
|
+
#include <cstdint>
|
|
20
|
+
#include <cstdio>
|
|
21
|
+
#include <cstring>
|
|
22
|
+
#include <atomic>
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
#include "esp_event.h"
|
|
26
|
+
#include "esp_log.h"
|
|
27
|
+
#include "esp_mac.h"
|
|
28
|
+
#include "esp_netif.h"
|
|
29
|
+
#include "esp_wifi.h"
|
|
30
|
+
#include "esp_heap_caps.h"
|
|
31
|
+
#include "esp_timer.h"
|
|
32
|
+
#include "freertos/FreeRTOS.h"
|
|
33
|
+
#include "freertos/event_groups.h"
|
|
34
|
+
#include "freertos/task.h"
|
|
35
|
+
#include "freertos/idf_additions.h"
|
|
36
|
+
|
|
37
|
+
#include "connectivity/wifi_task_stack.h"
|
|
38
|
+
#include "services/network_services.h"
|
|
39
|
+
|
|
40
|
+
#include "display.h"
|
|
41
|
+
|
|
42
|
+
namespace gea::targets::esp32::wifi {
|
|
43
|
+
|
|
44
|
+
namespace {
|
|
45
|
+
|
|
46
|
+
constexpr const char *kTag = "wifi";
|
|
47
|
+
constexpr int kScanMax = 20;
|
|
48
|
+
constexpr EventBits_t kConnectedBit = BIT0;
|
|
49
|
+
constexpr EventBits_t kFailBit = BIT1;
|
|
50
|
+
|
|
51
|
+
} // namespace
|
|
52
|
+
|
|
53
|
+
class WifiStation final : public gea::framework::network::WifiDriver {
|
|
54
|
+
public:
|
|
55
|
+
static WifiStation &instance()
|
|
56
|
+
{
|
|
57
|
+
static WifiStation station;
|
|
58
|
+
return station;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
bool init() override
|
|
62
|
+
{
|
|
63
|
+
// init() may be re-entered after a failed esp_wifi_init (the bring-up
|
|
64
|
+
// worker retries); only create what a previous attempt didn't leave behind.
|
|
65
|
+
if (!eventGroup_) eventGroup_ = xEventGroupCreate();
|
|
66
|
+
// Keep credentials set via configure(); fall back to the build-time
|
|
67
|
+
// defaults only when none were provided before this (deferred) bring-up.
|
|
68
|
+
if (ssid_[0] == '\0') {
|
|
69
|
+
std::snprintf(ssid_, sizeof(ssid_), "%s", GEA_EMBEDDED_WIFI_SSID);
|
|
70
|
+
std::snprintf(password_, sizeof(password_), "%s", GEA_EMBEDDED_WIFI_PASSWORD);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ESP_ERROR_CHECK(esp_netif_init());
|
|
74
|
+
// The default event loop may already exist when WiFi is brought up lazily
|
|
75
|
+
// after boot; tolerate ESP_ERR_INVALID_STATE rather than aborting.
|
|
76
|
+
{
|
|
77
|
+
const esp_err_t loopErr = esp_event_loop_create_default();
|
|
78
|
+
if (loopErr != ESP_OK && loopErr != ESP_ERR_INVALID_STATE) ESP_ERROR_CHECK(loopErr);
|
|
79
|
+
}
|
|
80
|
+
if (!netif_) netif_ = esp_netif_create_default_wifi_sta();
|
|
81
|
+
|
|
82
|
+
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
|
83
|
+
#if CONFIG_ESP_WIFI_ENABLED
|
|
84
|
+
// Use the smallest fixed DMA pools that leave room for BLE, the CO5300 SPI
|
|
85
|
+
// bus, and the HTTP task on this S3. Hardware measurement after BLE showed
|
|
86
|
+
// only 23,824 DMA bytes before WiFi: even a 3/8 RX, 2/1 TX/cache midpoint
|
|
87
|
+
// associated but left 1,212 bytes, and display initialization failed. The
|
|
88
|
+
// original slow OTA run also had a 6 KiB WiFi task and an 8 KiB HTTP task;
|
|
89
|
+
// those stacks are now 8 KiB and 4 KiB respectively, so keep the viable
|
|
90
|
+
// pool sizes and measure the corrected task configuration independently.
|
|
91
|
+
// TCP OTA is the primary bulk receive path. Buy its receive depth with the
|
|
92
|
+
// DYNAMIC frames, not the static ones: static RX frames are permanent
|
|
93
|
+
// internal DMA allocations (1600 B each) taken from the same few tens of KiB
|
|
94
|
+
// the display staging needs, while dynamic frames are allocated on demand
|
|
95
|
+
// and land in PSRAM under CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP. Sixteen
|
|
96
|
+
// dynamic frames match the widened TCP receive window; four static frames
|
|
97
|
+
// are the minimum that still permits an 8-deep block-ack window.
|
|
98
|
+
cfg.static_rx_buf_num = 4;
|
|
99
|
+
cfg.dynamic_rx_buf_num = 16;
|
|
100
|
+
cfg.rx_ba_win = 8; // ESP-IDF requires <= 2 * static_rx_buf_num.
|
|
101
|
+
cfg.static_tx_buf_num = 1;
|
|
102
|
+
cfg.cache_tx_buf_num = 1;
|
|
103
|
+
cfg.mgmt_sbuf_num = 6;
|
|
104
|
+
cfg.ampdu_tx_enable = 0;
|
|
105
|
+
// Give the blob's "wifi" task a stack it can authenticate on.
|
|
106
|
+
applyTaskStackOverride(&cfg);
|
|
107
|
+
#endif // CONFIG_ESP_WIFI_ENABLED — native RX-buf/osi tuning; remote (P4/C6) uses defaults
|
|
108
|
+
// esp_wifi_init wants ~50 KB of DMA-capable internal RAM. The display's
|
|
109
|
+
// elastic-RAM shrink (reserveInternal in ensureBringUp) frees it, but the
|
|
110
|
+
// shrink is applied by the frame task and can lose the race against this
|
|
111
|
+
// first allocation — a one-shot init then leaves WiFi down forever. Retry
|
|
112
|
+
// with backoff so a transiently tight heap doesn't become permanent.
|
|
113
|
+
ESP_LOGW(kTag, "pre-wifi-init heap: dma[free=%u largest=%u] int8[free=%u largest=%u]",
|
|
114
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA)),
|
|
115
|
+
static_cast<unsigned>(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA)),
|
|
116
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
117
|
+
static_cast<unsigned>(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)));
|
|
118
|
+
debugDmaFree_.store(
|
|
119
|
+
heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA),
|
|
120
|
+
std::memory_order_relaxed);
|
|
121
|
+
debugDmaLargest_.store(
|
|
122
|
+
heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA),
|
|
123
|
+
std::memory_order_relaxed);
|
|
124
|
+
// A failed esp_wifi_init can retain partial internal allocations. Retrying
|
|
125
|
+
// against the same memory state compounds pressure and cannot succeed; the
|
|
126
|
+
// outer bring-up scheduler is responsible for preparing memory first.
|
|
127
|
+
const esp_err_t err = esp_wifi_init(&cfg);
|
|
128
|
+
if (err != ESP_OK) {
|
|
129
|
+
debugLastError_.store(static_cast<int>(err), std::memory_order_relaxed);
|
|
130
|
+
debugState_.store(4, std::memory_order_relaxed);
|
|
131
|
+
ESP_LOGE(kTag, "esp_wifi_init failed (%s); continuing without WiFi", esp_err_to_name(err));
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
initialized_ = true;
|
|
135
|
+
|
|
136
|
+
ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &WifiStation::eventHandler, this, &evtAnyId_));
|
|
137
|
+
ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &WifiStation::eventHandler, this, &evtGotIp_));
|
|
138
|
+
|
|
139
|
+
wifi_config_t wifiConfig = {};
|
|
140
|
+
setCredentials(&wifiConfig, ssid_, password_);
|
|
141
|
+
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
|
|
142
|
+
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifiConfig));
|
|
143
|
+
ESP_ERROR_CHECK(esp_wifi_start());
|
|
144
|
+
started_ = true;
|
|
145
|
+
// Disable modem power-save. The default WIFI_PS_MIN_MODEM sleeps the radio
|
|
146
|
+
// between DTIM beacons; over a sustained multi-minute TLS upload the link
|
|
147
|
+
// goes unreliable and the server's response is lost (the device streams all
|
|
148
|
+
// 37 MB but never receives the /v1/files reply -> "upload HTTP -4"). An
|
|
149
|
+
// always-on radio keeps the connection alive end-to-end. It does not cost
|
|
150
|
+
// extra internal DMA RAM, so it is safe alongside the SD card's DMA reads.
|
|
151
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_set_ps(WIFI_PS_NONE));
|
|
152
|
+
|
|
153
|
+
const EventBits_t bits = xEventGroupWaitBits(
|
|
154
|
+
eventGroup_,
|
|
155
|
+
kConnectedBit | kFailBit,
|
|
156
|
+
pdFALSE,
|
|
157
|
+
pdFALSE,
|
|
158
|
+
pdMS_TO_TICKS(15000));
|
|
159
|
+
|
|
160
|
+
if (bits & kConnectedBit) return true;
|
|
161
|
+
debugState_.store(5, std::memory_order_relaxed);
|
|
162
|
+
ESP_LOGE(kTag, "WiFi connection timed out");
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
bool enabled() const override { return enabled_; }
|
|
167
|
+
|
|
168
|
+
void setEnabled(bool enabled) override
|
|
169
|
+
{
|
|
170
|
+
#ifdef GEA_EMBEDDED_WIFI_DISABLED
|
|
171
|
+
(void)enabled;
|
|
172
|
+
enabled_ = false;
|
|
173
|
+
return;
|
|
174
|
+
#endif
|
|
175
|
+
enabled_ = enabled;
|
|
176
|
+
|
|
177
|
+
if (!enabled_) {
|
|
178
|
+
if (!initialized_) return;
|
|
179
|
+
if (scanning_) {
|
|
180
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_scan_stop());
|
|
181
|
+
scanning_ = false;
|
|
182
|
+
}
|
|
183
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_disconnect());
|
|
184
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_stop());
|
|
185
|
+
// Full deinit to RECLAIM WiFi's DMA-capable internal RAM — esp_wifi_stop
|
|
186
|
+
// alone leaves the ~50-60 KB of buffers allocated. Tear down in reverse
|
|
187
|
+
// of init() (deinit -> unregister handlers -> destroy netif -> delete
|
|
188
|
+
// event group) so a later re-enable (ensureBringUp -> init()) re-creates
|
|
189
|
+
// everything cleanly with no double-register/double-create.
|
|
190
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_deinit());
|
|
191
|
+
if (evtAnyId_) {
|
|
192
|
+
esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, evtAnyId_);
|
|
193
|
+
evtAnyId_ = nullptr;
|
|
194
|
+
}
|
|
195
|
+
if (evtGotIp_) {
|
|
196
|
+
esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, evtGotIp_);
|
|
197
|
+
evtGotIp_ = nullptr;
|
|
198
|
+
}
|
|
199
|
+
if (netif_) {
|
|
200
|
+
esp_netif_destroy_default_wifi(netif_);
|
|
201
|
+
netif_ = nullptr;
|
|
202
|
+
}
|
|
203
|
+
if (eventGroup_) {
|
|
204
|
+
vEventGroupDelete(eventGroup_);
|
|
205
|
+
eventGroup_ = nullptr;
|
|
206
|
+
}
|
|
207
|
+
started_ = false;
|
|
208
|
+
initialized_ = false;
|
|
209
|
+
resetConnection();
|
|
210
|
+
// Release the staging-budget reservation so the display grows its
|
|
211
|
+
// staging buffers back now that WiFi's internal RAM is freed.
|
|
212
|
+
gea::platform::display::Display::reserveInternal(0);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Enable. First time: WiFi isn't initialized yet (opt-in — it's no longer
|
|
217
|
+
// brought up at boot), so kick off the async internal-stack bring-up worker
|
|
218
|
+
// and return immediately; the app polls connected(). Already initialized but
|
|
219
|
+
// stopped: just restart the radio. Already running: nothing to do.
|
|
220
|
+
if (!initialized_) {
|
|
221
|
+
ensureBringUp();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (started_) return;
|
|
225
|
+
if (ssid_[0] != '\0') {
|
|
226
|
+
wifi_config_t wifiConfig = {};
|
|
227
|
+
setCredentials(&wifiConfig, ssid_, password_);
|
|
228
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_set_config(WIFI_IF_STA, &wifiConfig));
|
|
229
|
+
}
|
|
230
|
+
const esp_err_t err = esp_wifi_start();
|
|
231
|
+
if (err == ESP_OK) started_ = true;
|
|
232
|
+
else ESP_LOGW(kTag, "esp_wifi_start failed while enabling WiFi: %s", esp_err_to_name(err));
|
|
233
|
+
if (started_ && ssid_[0] != '\0') ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_connect());
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
bool connected() const override
|
|
237
|
+
{
|
|
238
|
+
return connected_;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
int rssi() override
|
|
242
|
+
{
|
|
243
|
+
wifi_ap_record_t ap = {};
|
|
244
|
+
if (connected_ && esp_wifi_sta_get_ap_info(&ap) == ESP_OK) rssi_ = ap.rssi;
|
|
245
|
+
return connected_ ? rssi_ : 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
std::string ssid() override
|
|
249
|
+
{
|
|
250
|
+
wifi_ap_record_t ap = {};
|
|
251
|
+
if (connected_ && esp_wifi_sta_get_ap_info(&ap) == ESP_OK && ap.ssid[0] != '\0') {
|
|
252
|
+
std::snprintf(ssid_, sizeof(ssid_), "%s", reinterpret_cast<const char *>(ap.ssid));
|
|
253
|
+
}
|
|
254
|
+
return connected_ ? stringOrEmpty(ssid_) : std::string();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
std::string ip() const override { return connected_ ? stringOrEmpty(ip_) : std::string("0.0.0.0"); }
|
|
258
|
+
|
|
259
|
+
std::string mac() override
|
|
260
|
+
{
|
|
261
|
+
std::uint8_t macBytes[6] = {};
|
|
262
|
+
esp_err_t err = esp_wifi_get_mac(WIFI_IF_STA, macBytes);
|
|
263
|
+
if (err != ESP_OK) err = esp_read_mac(macBytes, ESP_MAC_WIFI_STA);
|
|
264
|
+
if (err != ESP_OK) return std::string();
|
|
265
|
+
std::snprintf(mac_, sizeof(mac_), "%02X:%02X:%02X:%02X:%02X:%02X",
|
|
266
|
+
macBytes[0], macBytes[1], macBytes[2], macBytes[3], macBytes[4], macBytes[5]);
|
|
267
|
+
return stringOrEmpty(mac_);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
void configure(const std::string &ssid, const std::string &password) override
|
|
271
|
+
{
|
|
272
|
+
const bool unchanged = ssid == ssid_ && password == password_;
|
|
273
|
+
if (unchanged && initialized_ && connected_) {
|
|
274
|
+
enabled_ = true;
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
debugState_.store(1, std::memory_order_relaxed);
|
|
278
|
+
std::snprintf(ssid_, sizeof(ssid_), "%s", ssid.c_str());
|
|
279
|
+
std::snprintf(password_, sizeof(password_), "%s", password.c_str());
|
|
280
|
+
resetConnection();
|
|
281
|
+
enabled_ = true;
|
|
282
|
+
|
|
283
|
+
// WiFi not up yet (opt-in): bring it up lazily with these credentials.
|
|
284
|
+
if (!initialized_) {
|
|
285
|
+
ensureBringUp();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (ssid_[0] == '\0') return;
|
|
289
|
+
|
|
290
|
+
wifi_config_t wifiConfig = {};
|
|
291
|
+
setCredentials(&wifiConfig, ssid.c_str(), password.c_str());
|
|
292
|
+
if (!started_ && esp_wifi_start() == ESP_OK) started_ = true;
|
|
293
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_disconnect());
|
|
294
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_set_config(WIFI_IF_STA, &wifiConfig));
|
|
295
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_connect());
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
void scan() override
|
|
299
|
+
{
|
|
300
|
+
if (!initialized_ || !enabled_ || scanning_) return;
|
|
301
|
+
|
|
302
|
+
wifi_scan_config_t scanConfig = {};
|
|
303
|
+
scanConfig.scan_type = WIFI_SCAN_TYPE_ACTIVE;
|
|
304
|
+
scanConfig.scan_time.active.min = 100;
|
|
305
|
+
scanConfig.scan_time.active.max = 300;
|
|
306
|
+
|
|
307
|
+
if (esp_wifi_scan_start(&scanConfig, false) == ESP_OK) scanning_ = true;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
bool scanning() const override { return scanning_; }
|
|
311
|
+
int scanCount() const override { return scanCount_; }
|
|
312
|
+
|
|
313
|
+
gea::framework::network::WifiNetwork networkAt(int index) const override
|
|
314
|
+
{
|
|
315
|
+
if (index < 0 || index >= scanCount_) return {};
|
|
316
|
+
return {
|
|
317
|
+
stringOrEmpty(scanSsids_[index]),
|
|
318
|
+
scanRssi_[index],
|
|
319
|
+
scanSecured_[index] != 0,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
std::vector<gea::framework::network::WifiNetwork> scanResults() const override
|
|
324
|
+
{
|
|
325
|
+
std::vector<gea::framework::network::WifiNetwork> results;
|
|
326
|
+
results.reserve(scanCount_ > 0 ? static_cast<std::size_t>(scanCount_) : 0);
|
|
327
|
+
for (int i = 0; i < scanCount_; i++) results.push_back(networkAt(i));
|
|
328
|
+
return results;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
private:
|
|
332
|
+
static void copyWifiString(std::uint8_t *destination, std::size_t destinationSize, const char *source)
|
|
333
|
+
{
|
|
334
|
+
std::memset(destination, 0, destinationSize);
|
|
335
|
+
if (!source) return;
|
|
336
|
+
|
|
337
|
+
std::size_t length = 0;
|
|
338
|
+
while (length < destinationSize && source[length] != '\0') length++;
|
|
339
|
+
std::memcpy(destination, source, length);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
static void setCredentials(wifi_config_t *config, const char *ssid, const char *password)
|
|
343
|
+
{
|
|
344
|
+
copyWifiString(config->sta.ssid, sizeof(config->sta.ssid), ssid);
|
|
345
|
+
copyWifiString(config->sta.password, sizeof(config->sta.password), password);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
static std::string stringOrEmpty(const char *value)
|
|
349
|
+
{
|
|
350
|
+
return value ? std::string(value) : std::string();
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
static void eventHandler(void *arg, esp_event_base_t eventBase, std::int32_t eventId, void *eventData)
|
|
354
|
+
{
|
|
355
|
+
static_cast<WifiStation *>(arg)->handleEvent(eventBase, eventId, eventData);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
void handleEvent(esp_event_base_t eventBase, std::int32_t eventId, void *eventData)
|
|
359
|
+
{
|
|
360
|
+
if (eventBase == WIFI_EVENT && eventId == WIFI_EVENT_STA_START) {
|
|
361
|
+
if (enabled_ && ssid_[0] != '\0') esp_wifi_connect();
|
|
362
|
+
} else if (eventBase == WIFI_EVENT && eventId == WIFI_EVENT_STA_DISCONNECTED) {
|
|
363
|
+
if (enabled_) ESP_LOGW(kTag, "WiFi disconnected, retrying...");
|
|
364
|
+
resetConnection();
|
|
365
|
+
if (enabled_ && ssid_[0] != '\0') esp_wifi_connect();
|
|
366
|
+
} else if (eventBase == IP_EVENT && eventId == IP_EVENT_STA_GOT_IP) {
|
|
367
|
+
auto *event = static_cast<ip_event_got_ip_t *>(eventData);
|
|
368
|
+
ESP_LOGI(kTag, "Connected! IP: " IPSTR, IP2STR(&event->ip_info.ip));
|
|
369
|
+
connected_ = true;
|
|
370
|
+
debugState_.store(6, std::memory_order_relaxed);
|
|
371
|
+
std::snprintf(ip_, sizeof(ip_), IPSTR, IP2STR(&event->ip_info.ip));
|
|
372
|
+
xEventGroupSetBits(eventGroup_, kConnectedBit);
|
|
373
|
+
// Association can finish after init()'s bounded wait has returned. Start
|
|
374
|
+
// the deferred OTA/diagnostics services on the actual address event too;
|
|
375
|
+
// NetworkServices ignores this until Runtime has supplied its policy.
|
|
376
|
+
gea::framework::services::NetworkServices::startDeferredServers();
|
|
377
|
+
} else if (eventBase == WIFI_EVENT && eventId == WIFI_EVENT_SCAN_DONE) {
|
|
378
|
+
handleScanDone();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
void resetConnection()
|
|
383
|
+
{
|
|
384
|
+
connected_ = false;
|
|
385
|
+
rssi_ = 0;
|
|
386
|
+
std::snprintf(ip_, sizeof(ip_), "0.0.0.0");
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
void handleScanDone()
|
|
390
|
+
{
|
|
391
|
+
std::uint16_t found = 0;
|
|
392
|
+
if (esp_wifi_scan_get_ap_num(&found) != ESP_OK) {
|
|
393
|
+
scanning_ = false;
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
std::uint16_t toRead = found > kScanMax ? kScanMax : found;
|
|
398
|
+
if (toRead > 0) {
|
|
399
|
+
std::uint16_t actual = toRead;
|
|
400
|
+
if (esp_wifi_scan_get_ap_records(&actual, scanRecords_) != ESP_OK) {
|
|
401
|
+
esp_wifi_clear_ap_list();
|
|
402
|
+
scanning_ = false;
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
toRead = actual;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
for (int i = 0; i < toRead; i++) {
|
|
409
|
+
std::snprintf(scanSsids_[i], sizeof(scanSsids_[i]), "%s", reinterpret_cast<const char *>(scanRecords_[i].ssid));
|
|
410
|
+
scanRssi_[i] = scanRecords_[i].rssi;
|
|
411
|
+
scanSecured_[i] = scanRecords_[i].authmode == WIFI_AUTH_OPEN ? 0 : 1;
|
|
412
|
+
}
|
|
413
|
+
scanCount_ = toRead;
|
|
414
|
+
scanning_ = false;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
void ensureBringUp()
|
|
418
|
+
{
|
|
419
|
+
#ifdef GEA_EMBEDDED_WIFI_DISABLED
|
|
420
|
+
return;
|
|
421
|
+
#endif
|
|
422
|
+
if (initialized_ || bringingUp_ || bringUpDeferred_) return;
|
|
423
|
+
// Always reserve display staging RAM before allocating the transient
|
|
424
|
+
// worker. App-level configure() runs during generated top-level code, before
|
|
425
|
+
// the frame scheduler has necessarily applied a pending display resize; an
|
|
426
|
+
// immediate worker could reach esp_wifi_init with only ~8 KB DMA free. The
|
|
427
|
+
// configure path runs on the app/frame task, so apply the resize here before
|
|
428
|
+
// deferring the stack-hungry native initialization to its worker.
|
|
429
|
+
gea::platform::display::Display::reserveInternal(56 * 1024);
|
|
430
|
+
gea::platform::display::Display::applyPendingInternalReserve();
|
|
431
|
+
if (startBringUpWorker()) {
|
|
432
|
+
// The generated app task has the top FreeRTOS priority. Yield once to the
|
|
433
|
+
// equally prioritized worker so Wi-Fi claims the released DMA RAM before
|
|
434
|
+
// mount() resumes and native UI allocations reuse it.
|
|
435
|
+
taskYIELD();
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
bringUpDeferred_ = true;
|
|
439
|
+
bringUpDeferFrames_ = 0;
|
|
440
|
+
debugState_.store(3, std::memory_order_relaxed);
|
|
441
|
+
scheduleDeferredBringUp();
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Create the transient internal-stack bring-up worker. esp_wifi_init +
|
|
445
|
+
// esp_netif setup are stack-hungry (the original boot path ran them on the
|
|
446
|
+
// 32 KB main task; 8 KB overflowed, 24 KB left no contiguous internal block
|
|
447
|
+
// for esp_wifi_init's own driver-task stack), so 16 KB is the tuned margin,
|
|
448
|
+
// freed as soon as bring-up ends. Returns false if the stack can't be
|
|
449
|
+
// allocated, so the caller can free RAM and retry instead of giving up.
|
|
450
|
+
bool startBringUpWorker()
|
|
451
|
+
{
|
|
452
|
+
bringingUp_ = true;
|
|
453
|
+
// 10 KB (was 13/16 KB): this stack is held in internal RAM THROUGHOUT
|
|
454
|
+
// esp_wifi_init, so it bounds the largest contiguous DMA block esp_wifi can
|
|
455
|
+
// carve for its own buffers. On maps the static esf_buf pool now fits, but
|
|
456
|
+
// the next esp_wifi alloc needs > the ~11 KB largest free block, which the
|
|
457
|
+
// 16 KB worker caps. esp_wifi_init's call depth needs > 8 KB (8 KB
|
|
458
|
+
// overflowed historically), so 10 KB keeps a 2 KB margin while returning
|
|
459
|
+
// another 3 KB to the DMA heap for BLE + WiFi coexistence.
|
|
460
|
+
const BaseType_t ok = xTaskCreateWithCaps(
|
|
461
|
+
&WifiStation::bringUpTrampoline, "wifi_up", 10240, this,
|
|
462
|
+
configMAX_PRIORITIES - 1, nullptr,
|
|
463
|
+
MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
|
464
|
+
if (ok != pdPASS) {
|
|
465
|
+
bringingUp_ = false;
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
468
|
+
bringUpDeferred_ = false;
|
|
469
|
+
debugState_.store(2, std::memory_order_relaxed);
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
void scheduleDeferredBringUp()
|
|
474
|
+
{
|
|
475
|
+
if (!bringUpRetryTimer_) {
|
|
476
|
+
const esp_timer_create_args_t args = {
|
|
477
|
+
.callback = &WifiStation::deferredBringUpTimer,
|
|
478
|
+
.arg = this,
|
|
479
|
+
.dispatch_method = ESP_TIMER_TASK,
|
|
480
|
+
.name = "wifi_retry",
|
|
481
|
+
.skip_unhandled_events = true,
|
|
482
|
+
};
|
|
483
|
+
if (esp_timer_create(&args, &bringUpRetryTimer_) != ESP_OK) {
|
|
484
|
+
ESP_LOGE(kTag, "wifi bring-up retry timer create failed");
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if (!esp_timer_is_active(bringUpRetryTimer_)) {
|
|
489
|
+
// Keep ticking until retryDeferredBringUp() either creates the worker
|
|
490
|
+
// or reaches its bounded timeout. A one-shot timer cannot safely rely on
|
|
491
|
+
// re-arming itself while its callback is still considered active: the
|
|
492
|
+
// active check can suppress the re-arm after the very first tick.
|
|
493
|
+
esp_timer_start_periodic(bringUpRetryTimer_, 50 * 1000);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
static void deferredBringUpTimer(void *arg)
|
|
498
|
+
{
|
|
499
|
+
static_cast<WifiStation *>(arg)->retryDeferredBringUp();
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// After a failed worker create armed the staging shrink, give the frame task
|
|
503
|
+
// a few frames to apply it, then retry independently of application polling.
|
|
504
|
+
// Gives up after roughly three seconds and releases the reservation.
|
|
505
|
+
void retryDeferredBringUp()
|
|
506
|
+
{
|
|
507
|
+
if (!bringUpDeferred_ || initialized_ || bringingUp_) {
|
|
508
|
+
if (bringUpRetryTimer_ && esp_timer_is_active(bringUpRetryTimer_)) {
|
|
509
|
+
esp_timer_stop(bringUpRetryTimer_);
|
|
510
|
+
}
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
bringUpDeferFrames_++;
|
|
514
|
+
if (bringUpDeferFrames_ >= 3 && startBringUpWorker()) {
|
|
515
|
+
if (bringUpRetryTimer_ && esp_timer_is_active(bringUpRetryTimer_)) {
|
|
516
|
+
esp_timer_stop(bringUpRetryTimer_);
|
|
517
|
+
}
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (bringUpDeferFrames_ > 60) {
|
|
521
|
+
if (bringUpRetryTimer_ && esp_timer_is_active(bringUpRetryTimer_)) {
|
|
522
|
+
esp_timer_stop(bringUpRetryTimer_);
|
|
523
|
+
}
|
|
524
|
+
bringUpDeferred_ = false;
|
|
525
|
+
gea::platform::display::Display::reserveInternal(0);
|
|
526
|
+
ESP_LOGE(kTag, "wifi bring-up worker create failed after staging shrink; WiFi unavailable");
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
static void bringUpTrampoline(void *arg)
|
|
532
|
+
{
|
|
533
|
+
// Runs on this transient worker's internal-RAM stack: esp_wifi_init reads
|
|
534
|
+
// calibration from NVS, which disables the flash cache (PSRAM unreachable),
|
|
535
|
+
// so the bring-up must not run on the app's PSRAM stack. Deferred to here
|
|
536
|
+
// so WiFi is only initialized when an app actually enables it.
|
|
537
|
+
auto *self = static_cast<WifiStation *>(arg);
|
|
538
|
+
// Elastic-RAM arbiter: free internal RAM for esp_wifi_init's DMA buffers by
|
|
539
|
+
// shrinking the display's staging buffers first, then give the frame task a
|
|
540
|
+
// few frames to apply the shrink before we allocate. Released on disable.
|
|
541
|
+
gea::platform::display::Display::reserveInternal(56 * 1024);
|
|
542
|
+
const bool connected = self->init();
|
|
543
|
+
if (connected) gea::framework::services::NetworkServices::startDeferredServers();
|
|
544
|
+
self->bringingUp_ = false;
|
|
545
|
+
vTaskDeleteWithCaps(nullptr);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
public:
|
|
549
|
+
int debugState() const { return debugState_.load(std::memory_order_relaxed); }
|
|
550
|
+
int debugLastError() const { return debugLastError_.load(std::memory_order_relaxed); }
|
|
551
|
+
std::uint32_t debugDmaFree() const { return debugDmaFree_.load(std::memory_order_relaxed); }
|
|
552
|
+
std::uint32_t debugDmaLargest() const { return debugDmaLargest_.load(std::memory_order_relaxed); }
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
private:
|
|
556
|
+
EventGroupHandle_t eventGroup_ = nullptr;
|
|
557
|
+
bool connected_ = false;
|
|
558
|
+
#ifdef GEA_EMBEDDED_WIFI_DISABLED
|
|
559
|
+
bool enabled_ = false;
|
|
560
|
+
#else
|
|
561
|
+
bool enabled_ = true;
|
|
562
|
+
#endif
|
|
563
|
+
bool initialized_ = false;
|
|
564
|
+
bool bringingUp_ = false;
|
|
565
|
+
// Deferred bring-up state: set when a worker create fails for lack of internal
|
|
566
|
+
// RAM and we've armed a staging shrink to retry once the RAM frees up.
|
|
567
|
+
bool bringUpDeferred_ = false;
|
|
568
|
+
int bringUpDeferFrames_ = 0;
|
|
569
|
+
esp_timer_handle_t bringUpRetryTimer_ = nullptr;
|
|
570
|
+
std::atomic<int> debugState_{0};
|
|
571
|
+
std::atomic<int> debugLastError_{0};
|
|
572
|
+
std::atomic<std::uint32_t> debugDmaFree_{0};
|
|
573
|
+
std::atomic<std::uint32_t> debugDmaLargest_{0};
|
|
574
|
+
bool started_ = false;
|
|
575
|
+
esp_netif_t *netif_ = nullptr;
|
|
576
|
+
esp_event_handler_instance_t evtAnyId_ = nullptr;
|
|
577
|
+
esp_event_handler_instance_t evtGotIp_ = nullptr;
|
|
578
|
+
int rssi_ = 0;
|
|
579
|
+
char ssid_[33] = "";
|
|
580
|
+
char password_[65] = "";
|
|
581
|
+
char ip_[16] = "0.0.0.0";
|
|
582
|
+
char mac_[18] = "";
|
|
583
|
+
bool scanning_ = false;
|
|
584
|
+
int scanCount_ = 0;
|
|
585
|
+
char scanSsids_[kScanMax][33]{};
|
|
586
|
+
int scanRssi_[kScanMax]{};
|
|
587
|
+
int scanSecured_[kScanMax]{};
|
|
588
|
+
wifi_ap_record_t scanRecords_[kScanMax]{};
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
// Explicit driver registration. MUST be called from a TU that is always linked
|
|
592
|
+
// (the runtime boot path). Until 2026-05-28, this lived in an anonymous-
|
|
593
|
+
// namespace global-ctor pattern (`WifiDriverRegistration` + static instance),
|
|
594
|
+
// which compiled fine but the resulting archive entry was never pulled into
|
|
595
|
+
// the final ELF: ESP-IDF puts every source under `main/CMakeLists.txt` into
|
|
596
|
+
// one `libmain.a` archive, and three different files all named `wifi.cpp`
|
|
597
|
+
// (this one, lib/gea-embedded/wifi.cpp, lib/gea-embedded/host/wifi.cpp) all
|
|
598
|
+
// archived as `wifi.cpp.obj`. Symbol-driven archive linking only pulls an obj
|
|
599
|
+
// in when something external references its symbols; the static-init global
|
|
600
|
+
// here has no external references, so this obj was dropped, leaving
|
|
601
|
+
// `NullWifiDriver` as the active driver — `init()` returned false instantly,
|
|
602
|
+
// `enabled()` always reported false, `setEnabled()` was a no-op.
|
|
603
|
+
void registerDriver()
|
|
604
|
+
{
|
|
605
|
+
::gea::framework::network::WifiAdapter::setDriver(&WifiStation::instance());
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
namespace wifi_debug {
|
|
609
|
+
int state() { return WifiStation::instance().debugState(); }
|
|
610
|
+
int lastError() { return WifiStation::instance().debugLastError(); }
|
|
611
|
+
std::uint32_t dmaFree() { return WifiStation::instance().debugDmaFree(); }
|
|
612
|
+
std::uint32_t dmaLargest() { return WifiStation::instance().debugDmaLargest(); }
|
|
613
|
+
} // namespace wifi_debug
|
|
614
|
+
|
|
615
|
+
} // namespace gea::targets::esp32::wifi
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// The Wi-Fi diagnostics a build without the network capability still has to
|
|
2
|
+
// answer.
|
|
3
|
+
//
|
|
4
|
+
// ble_hid.cpp reports Wi-Fi state alongside OTA state in its status
|
|
5
|
+
// notification, and that notification is compiled whenever BLE OTA is enabled.
|
|
6
|
+
// connectivity/wifi.cpp, which defines these, only builds with the network
|
|
7
|
+
// capability, so a BLE-only app referenced them and failed to link. This stub
|
|
8
|
+
// reports the same values that a build with Wi-Fi compiled in but never started
|
|
9
|
+
// would report -- state 0 is WifiStation's own initial "never started" -- so the
|
|
10
|
+
// notification stays truthful without inventing a protocol value for it.
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#include "esp_heap_caps.h"
|
|
14
|
+
|
|
15
|
+
namespace gea::targets::esp32::wifi::wifi_debug {
|
|
16
|
+
|
|
17
|
+
int state()
|
|
18
|
+
{
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
int lastError()
|
|
23
|
+
{
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
std::uint32_t dmaFree()
|
|
28
|
+
{
|
|
29
|
+
return heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
std::uint32_t dmaLargest()
|
|
33
|
+
{
|
|
34
|
+
return heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
} // namespace gea::targets::esp32::wifi::wifi_debug
|