Platforms (Arduino, Platform IO, ESP IDF) - mriksman/esp-idf-homekit GitHub Wiki

Arduino, Platform IO and Espressif

ESP32 has;

  • Arduino is similar to ESP-IDF v3.3
  • PlatformIO has
    • Arduino support (uses toolchain-xtensa32 2.5)
    • ESP-IDF v3.3 (uses toolchain-xtensa32 2.5)
  • Espressif's ESP-IDF version is now v4.1

The ESP8266 has;

  • Arduino is a NONOS (No OS) platform. It doesn't support tasks, and so doesn't support the esp‑homekit library.
  • PlatformIO has
    • Arduino support (uses toolchain-xtensa)
    • ESP8266 RTOS SDK v1.5beta5 (uses [email protected])
    • ESP8266 NONOS SDK
  • Espressif's ESP8266 RTOS SDK version is now v3.3, and closely resembles ESP-IDF (as of v3.0).

When you choose an Arduino platform;

src/main.cpp

 #include <Arduino.h>

 void setup() {
   // put your setup code here, to run once:
 }

 void loop() {
   // put your main code here, to run repeatedly:
 }

When you choose an ESP-IDF (or ESP8266 RTOS v3.x or later) based platform;

src/sdkconfig.h

src/whatever.cpp

 #include <stdio.h>
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"

 // required if programming in cpp
 extern "C" {
     void app_main(void);
 }

 void app_main() {
 // essentially the setup() stuff
 while(1) {
 //essentially the loop() stuff

When you choose an ESP8266 RTOS SDK v2.x or earlier (like PlatformIO's v1.5beta5) based platform;

src/user_main.c

#include "esp_common.h"

 uint32 user_rf_cal_sector_set(void) {
  // see code examples for reason it's required
 }

 void user_init(void) {
 // essentially the setup() stuff
 while(1) {
 //essentially the loop() stuff

sdkconfig.h is not required, and it uses user_init() as the entry function.

⚠️ **GitHub.com Fallback** ⚠️