MCPcopy Create free account
hub / github.com/BruceDevices/firmware / gsetIrTxPin

Function gsetIrTxPin

src/core/settings.cpp:1051–1084  ·  view source on GitHub ↗

** Function: gsetIrTxPin ** get or set IR Tx Pin **********************************************************************/

Source from the content-addressed store, hash-verified

1049** get or set IR Tx Pin
1050**********************************************************************/
1051int gsetIrTxPin(bool set) {
1052 int result = bruceConfigPins.irTx;
1053
1054 if (result > 50) bruceConfigPins.setIrTxPin(TXLED);
1055 if (set) {
1056 options.clear();
1057 std::vector<std::pair<const char *, int>> pins;
1058 pins = IR_TX_PINS;
1059 int idx = 100;
1060 int j = 0;
1061 for (auto pin : pins) {
1062 if (pin.second == bruceConfigPins.irTx && idx == 100) idx = j;
1063 j++;
1064#ifdef ALLOW_ALL_GPIO_FOR_IR_RF
1065 int i = pin.second;
1066 if (i != TFT_CS && i != TFT_RST && i != TFT_SCLK && i != TFT_MOSI && i != TFT_BL &&
1067 i != TOUCH_CS && i != SDCARD_CS && i != SDCARD_MOSI && i != SDCARD_MISO)
1068#endif
1069 options.push_back(
1070 {pin.first,
1071 [=]() { bruceConfigPins.setIrTxPin(pin.second); },
1072 pin.second == bruceConfigPins.irTx}
1073 );
1074 }
1075
1076 loopOptions(options, idx);
1077 options.clear();
1078
1079 Serial.println("Saved pin: " + String(bruceConfigPins.irTx));
1080 }
1081
1082 returnToMenu = true;
1083 return bruceConfigPins.irTx;
1084}
1085
1086void setIrTxRepeats() {
1087 uint8_t chRpts = 0; // Chosen Repeats

Callers 1

checkIrTxPinFunction · 0.85

Calls 4

setIrTxPinMethod · 0.80
loopOptionsFunction · 0.70
clearMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected