mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Merge pull request #10301 from s-hadinger/ir_add_compile_options
Add IR_SEND_INVERTED and IR_SEND_USE_MODULATION compile options
This commit is contained in:
commit
2278d5894e
@ -719,6 +719,10 @@
|
|||||||
|
|
||||||
// -- IR Remote features - subset of IR protocols --------------------------
|
// -- IR Remote features - subset of IR protocols --------------------------
|
||||||
#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram)
|
#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram)
|
||||||
|
#define IR_SEND_INVERTED false // Invert the output. (default = false) e.g. LED is illuminated when GPIO is LOW rather than HIGH.
|
||||||
|
// Setting inverted to something other than the default could easily destroy your IR LED if you are overdriving it.
|
||||||
|
// Unless you REALLY know what you are doing, don't change this.
|
||||||
|
#define IR_SEND_USE_MODULATION true // Do we do frequency modulation during transmission? i.e. If not, assume a 100% duty cycle.
|
||||||
#define USE_IR_SEND_NEC // Support IRsend NEC protocol
|
#define USE_IR_SEND_NEC // Support IRsend NEC protocol
|
||||||
#define USE_IR_SEND_RC5 // Support IRsend Philips RC5 protocol
|
#define USE_IR_SEND_RC5 // Support IRsend Philips RC5 protocol
|
||||||
#define USE_IR_SEND_RC6 // Support IRsend Philips RC6 protocol
|
#define USE_IR_SEND_RC6 // Support IRsend Philips RC6 protocol
|
||||||
|
@ -128,7 +128,7 @@ IRsend *irsend = nullptr;
|
|||||||
|
|
||||||
void IrSendInit(void)
|
void IrSendInit(void)
|
||||||
{
|
{
|
||||||
irsend = new IRsend(Pin(GPIO_IRSEND)); // an IR led is at GPIO_IRSEND
|
irsend = new IRsend(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION); // an IR led is at GPIO_IRSEND
|
||||||
irsend->begin();
|
irsend->begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ StateModes strToStateMode(class JsonParserToken token, StateModes def); // decla
|
|||||||
|
|
||||||
void IrSendInit(void)
|
void IrSendInit(void)
|
||||||
{
|
{
|
||||||
irsend = new IRsend(Pin(GPIO_IRSEND)); // an IR led is at GPIO_IRSEND
|
irsend = new IRsend(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION); // an IR led is at GPIO_IRSEND
|
||||||
irsend->begin();
|
irsend->begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)
|
|||||||
|
|
||||||
if (!IR_RCV_WHILE_SENDING && (irrecv != nullptr)) { irrecv->disableIRIn(); }
|
if (!IR_RCV_WHILE_SENDING && (irrecv != nullptr)) { irrecv->disableIRIn(); }
|
||||||
if (stateMode == StateModes::SEND_ONLY || stateMode == StateModes::SEND_STORE) {
|
if (stateMode == StateModes::SEND_ONLY || stateMode == StateModes::SEND_STORE) {
|
||||||
IRac ac(Pin(GPIO_IRSEND));
|
IRac ac(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION);
|
||||||
bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr);
|
bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr);
|
||||||
if (!success) { return IE_SYNTAX_IRHVAC; }
|
if (!success) { return IE_SYNTAX_IRHVAC; }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user