Update IRRemote ESP8266 to 2.6.2 and add ESP32 support
This commit is contained in:
1 parent
2ee18320be
commit
24bcdbc97c
195 files changed
+22963
-4737
No files matched your search
@@ -19,27 +19,30 @@
|
||||
* Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009,
|
||||
*/
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
#include <Arduino.h>
|
||||
#endif
|
||||
#include <IRrecv.h>
|
||||
#include <IRremoteESP8266.h>
|
||||
#include <IRutils.h>
|
||||
// The following are only needed for extended decoding of A/C Messages
|
||||
#include <ir_Argo.h>
|
||||
#include <ir_Coolix.h>
|
||||
#include <ir_Daikin.h>
|
||||
#include <ir_Fujitsu.h>
|
||||
#include <ir_Goodweather.h>
|
||||
#include <ir_Gree.h>
|
||||
#include <ir_Haier.h>
|
||||
#include <ir_Hitachi.h>
|
||||
#include <ir_Kelvinator.h>
|
||||
#include <ir_Midea.h>
|
||||
#include <ir_Mitsubishi.h>
|
||||
#include <ir_MitsubishiHeavy.h>
|
||||
#include <ir_Panasonic.h>
|
||||
#include <ir_Samsung.h>
|
||||
#include <ir_Sharp.h>
|
||||
#include <ir_Tcl.h>
|
||||
#include <ir_Teco.h>
|
||||
#include <ir_Toshiba.h>
|
||||
#include <ir_Trotec.h>
|
||||
#include <ir_Vestel.h>
|
||||
#include <ir_Whirlpool.h>
|
||||
|
||||
@@ -117,8 +120,15 @@ IRrecv irrecv(kRecvPin, kCaptureBufferSize, kTimeout, true);
|
||||
decode_results results; // Somewhere to store the results
|
||||
|
||||
// Display the human readable state of an A/C message if we can.
|
||||
void dumpACInfo(decode_results *results) {
|
||||
void dumpACInfo(const decode_results * const results) {
|
||||
String description = "";
|
||||
#if DECODE_ARGO
|
||||
if (results->decode_type == ARGO) {
|
||||
IRArgoAC ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_ARGO
|
||||
#if DECODE_DAIKIN
|
||||
if (results->decode_type == DAIKIN) {
|
||||
IRDaikinESP ac(0);
|
||||
@@ -133,6 +143,13 @@ void dumpACInfo(decode_results *results) {
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_DAIKIN2
|
||||
#if DECODE_DAIKIN216
|
||||
if (results->decode_type == DAIKIN216) {
|
||||
IRDaikin216 ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_DAIKIN216
|
||||
#if DECODE_FUJITSU_AC
|
||||
if (results->decode_type == FUJITSU_AC) {
|
||||
IRFujitsuAC ac(0);
|
||||
@@ -154,6 +171,18 @@ void dumpACInfo(decode_results *results) {
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_MITSUBISHI_AC
|
||||
#if DECODE_MITSUBISHIHEAVY
|
||||
if (results->decode_type == MITSUBISHI_HEAVY_88) {
|
||||
IRMitsubishiHeavy88Ac ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
if (results->decode_type == MITSUBISHI_HEAVY_152) {
|
||||
IRMitsubishiHeavy152Ac ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_MITSUBISHIHEAVY
|
||||
#if DECODE_TOSHIBA_AC
|
||||
if (results->decode_type == TOSHIBA_AC) {
|
||||
IRToshibaAC ac(0);
|
||||
@@ -161,6 +190,20 @@ void dumpACInfo(decode_results *results) {
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_TOSHIBA_AC
|
||||
#if DECODE_TROTEC
|
||||
if (results->decode_type == TROTEC) {
|
||||
IRTrotecESP ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_TROTEC
|
||||
#if DECODE_GOODWEATHER
|
||||
if (results->decode_type == GOODWEATHER) {
|
||||
IRGoodweatherAc ac(0);
|
||||
ac.setRaw(results->value); // Goodweather uses value instead of state.
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_GOODWEATHER
|
||||
#if DECODE_GREE
|
||||
if (results->decode_type == GREE) {
|
||||
IRGreeAC ac(0);
|
||||
@@ -196,6 +239,13 @@ void dumpACInfo(decode_results *results) {
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_SAMSUNG_AC
|
||||
#if DECODE_SHARP_AC
|
||||
if (results->decode_type == SHARP_AC) {
|
||||
IRSharpAc ac(0);
|
||||
ac.setRaw(results->state);
|
||||
description = ac.toString();
|
||||
}
|
||||
#endif // DECODE_SHARP_AC
|
||||
#if DECODE_COOLIX
|
||||
if (results->decode_type == COOLIX) {
|
||||
IRCoolixAC ac(0);
|
||||
@@ -250,9 +300,13 @@ void dumpACInfo(decode_results *results) {
|
||||
if (description != "") Serial.println("Mesg Desc.: " + description);
|
||||
}
|
||||
|
||||
// The section of code run only once at start-up.
|
||||
// This section of code runs only once at start-up.
|
||||
void setup() {
|
||||
#if defined(ESP8266)
|
||||
Serial.begin(kBaudRate, SERIAL_8N1, SERIAL_TX_ONLY);
|
||||
#else // ESP8266
|
||||
Serial.begin(kBaudRate, SERIAL_8N1);
|
||||
#endif // ESP8266
|
||||
while (!Serial) // Wait for the serial connection to be establised.
|
||||
delay(50);
|
||||
Serial.println();
|
||||
|
||||
@@ -6,11 +6,23 @@ src_dir=.
|
||||
build_flags =
|
||||
lib_deps_builtin =
|
||||
lib_deps_external =
|
||||
lib_ldf_mode = chain+
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = nodemcuv2
|
||||
lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
build_flags = ${common.build_flags}
|
||||
lib_deps =
|
||||
${common.lib_deps_builtin}
|
||||
${common.lib_deps_external}
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = esp32dev
|
||||
lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
build_flags = ${common.build_flags}
|
||||
lib_deps =
|
||||
${common.lib_deps_builtin}
|
||||
|
||||
Reference in new issue
Block a user