maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.1k stars 169 forks source link

Fix debug on esp-idf and make it work with ESP8266_RTOS_SDK 3.2 #99

Closed Fonger closed 4 years ago

Fonger commented 4 years ago

This repo actually works with Espressif's official (ESP8266_RTOS_SDK v3.2) because both of them are in esp-idf compliant style (well, at least a lot of migration process has been done, and #ESP_IDF is defined in ESP8266 SDK now).

The rationale of movingesp_system.h to port.h is that storage.c requires bool true false definition included in esp_system.h >> stdbool.h

I've tested this in esp-homekit-demo with an additional header #include <driver/gpio.h> and it actually compiles esp-homekit-demo/esp32/led example on ESP8266 and it works perfectly!

My menuconfig configuration:

Serial flasher config --->
    Default baud rate (115200 baud, maybe higher, I use 921600 to increase flash speed)
    'make monitor' baud rate (115200 bps)
    Flash Size (4MB, Mine is NodeMCU v3)
Component config --->
    ESP8266-specific --->
    (115200) UART console baud rate
    [ ] Initialize Task Watchdog Timer on startup
    [ ] Invoke panic handler on Task watchdog timeout
mDNS --->
    [*] Enable mDNS

Especially Task Watchdog part, if you don't disable it, during paring, the task will execute too long and the dog will bark and your kernel will panic.