This commit is contained in:
2025-11-28 18:26:32 -06:00
commit 8bb08d2819
21 changed files with 3309 additions and 0 deletions

8
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,8 @@
# This file was automatically generated for projects
# without default 'CMakeLists.txt' file.
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.* ${CMAKE_SOURCE_DIR}/include/*.cpp)
idf_component_register(SRCS ${app_sources}
INCLUDE_DIRS "."
REQUIRES nvs_flash esp-nimble-cpp)

25
src/main.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include <driver/gptimer.h>
#include "pwm.h"
#include "defines.h"
#include "nvs_flash.h"
#include "NimBLEDevice.h"
#include "BLE.hpp"
#include "WiFi.hpp"
extern "C" void app_main() {
esp_err_t ret = nvs_flash_init();
// 2. If NVS is full or corrupt (common after flashing new code), erase and retry
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
init_wifi();
NimBLEAdvertising* pAdv = initBLE();
while (1) {
BLEtick(pAdv);
vTaskDelay(pdMS_TO_TICKS(10));
}
}