From d231c5bda174f85da4b54cce5245fbeb0599fa71 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Tue, 22 Oct 2019 21:07:59 +0200 Subject: [PATCH] add m5stick-c board (#473) --- main/config_IR.h | 34 ++++++++++++++++++++++------------ platformio.ini | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/main/config_IR.h b/main/config_IR.h index 6c2e937..0ede2ec 100644 --- a/main/config_IR.h +++ b/main/config_IR.h @@ -129,18 +129,28 @@ extern void MQTTtoIR(char * topicOri, JsonObject& RFdata); #endif /*-------------------PIN DEFINITIONS----------------------*/ -#ifdef ESP8266 - #define IR_RECEIVER_PIN 2 //D4 /replace by 4 with sonoff rf bridge - #define IR_EMITTER_PIN 16 //D0/ replace by 0 (D3) if you use IR LOLIN controller shield /replace by 5 with sonoff rf bridge -#elif ESP32 - #define IR_RECEIVER_PIN 26 - #define IR_EMITTER_PIN 14 -#elif __AVR_ATmega2560__ - #define IR_RECEIVER_PIN 2 // 2 = D2 on arduino mega - #define IR_EMITTER_PIN 9 -#else - #define IR_RECEIVER_PIN 0 // 0 = D2 on arduino UNO - #define IR_EMITTER_PIN 9 +#ifndef IR_RECEIVER_PIN + #ifdef ESP8266 + #define IR_RECEIVER_PIN 2 //D4 /replace by 4 with sonoff rf bridge + #elif ESP32 + #define IR_RECEIVER_PIN 26 + #elif __AVR_ATmega2560__ + #define IR_RECEIVER_PIN 2 // 2 = D2 on arduino mega + #else + #define IR_RECEIVER_PIN 0 // 0 = D2 on arduino UNO + #endif +#endif + +#ifndef IR_EMITTER_PIN + #ifdef ESP8266 + #define IR_EMITTER_PIN 16 //D0/ replace by 0 (D3) if you use IR LOLIN controller shield /replace by 5 with sonoff rf bridge + #elif ESP32 + #define IR_EMITTER_PIN 14 + #elif __AVR_ATmega2560__ + #define IR_EMITTER_PIN 9 + #else + #define IR_EMITTER_PIN 9 + #endif #endif #endif \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 4bf0b3b..7473972 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,6 +34,7 @@ extra_configs = ;default_envs = esp32dev-pilight ;default_envs = esp32dev-ir ;default_envs = esp32dev-ble +;default_envs = esp32-m5stick-c-ble ;default_envs = ttgo-lora32-v1 ;default_envs = nodemcuv2-rf ;default_envs = rf-wifi-gateway @@ -227,6 +228,24 @@ build_flags = '-DZgatewayBT="BT"' '-DGateway_Name="OpenMQTTGateway_ESP32_BLE"' +[env:esp32-m5stick-c-ble] +platform = ${com.esp32_platform} +board = m5stick-c +board_build.partitions = min_spiffs.csv +lib_deps = + ${com-esp.lib_deps} + ${libraries.ble} + ${libraries.irremoteesp} +build_flags = + ${com-esp.build_flags} + '-DZgatewayBT="BT"' + '-DZgatewayIR="IR"' + '-DZsensorGPIOInput="GPIOInput"' + '-DGPIOInput_PIN=37' + '-DIR_EMITTER_PIN=9' + '-DGateway_Name="OpenMQTTGateway_ESP32_M5STICK_C_BLE_IR"' +board_upload.speed = 1500000 + [env:ttgo-lora32-v1] platform = ${com.esp32_platform} board = ttgo-lora32-v1