Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IR_SEND_INVERTED and IR_SEND_USE_MODULATION compile options #10301

Merged
merged 1 commit into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@

// -- 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 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_RC5 // Support IRsend Philips RC5 protocol
#define USE_IR_SEND_RC6 // Support IRsend Philips RC6 protocol
Expand Down
2 changes: 1 addition & 1 deletion tasmota/xdrv_05_irremote.ino
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ IRsend *irsend = nullptr;

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();
}

Expand Down
4 changes: 2 additions & 2 deletions tasmota/xdrv_05_irremote_full.ino
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ StateModes strToStateMode(class JsonParserToken token, StateModes def); // decla

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();
}

Expand Down Expand Up @@ -470,7 +470,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)

if (!IR_RCV_WHILE_SENDING && (irrecv != nullptr)) { irrecv->disableIRIn(); }
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);
if (!success) { return IE_SYNTAX_IRHVAC; }
}
Expand Down