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

Function gsetIrRxPin

src/core/settings.cpp:1112–1142  ·  view source on GitHub ↗

** Function: gsetIrRxPin ** get or set IR Rx Pin **********************************************************************/

Source from the content-addressed store, hash-verified

1110** get or set IR Rx Pin
1111**********************************************************************/
1112int gsetIrRxPin(bool set) {
1113 int result = bruceConfigPins.irRx;
1114
1115 if (result > 45) bruceConfigPins.setIrRxPin(GROVE_SCL);
1116 if (set) {
1117 options.clear();
1118 std::vector<std::pair<const char *, int>> pins;
1119 pins = IR_RX_PINS;
1120 int idx = -1;
1121 int j = 0;
1122 for (auto pin : pins) {
1123 if (pin.second == bruceConfigPins.irRx && idx < 0) idx = j;
1124 j++;
1125#ifdef ALLOW_ALL_GPIO_FOR_IR_RF
1126 int i = pin.second;
1127 if (i != TFT_CS && i != TFT_RST && i != TFT_SCLK && i != TFT_MOSI && i != TFT_BL &&
1128 i != TOUCH_CS && i != SDCARD_CS && i != SDCARD_MOSI && i != SDCARD_MISO)
1129#endif
1130 options.push_back(
1131 {pin.first,
1132 [=]() { bruceConfigPins.setIrRxPin(pin.second); },
1133 pin.second == bruceConfigPins.irRx}
1134 );
1135 }
1136
1137 loopOptions(options);
1138 }
1139
1140 returnToMenu = true;
1141 return bruceConfigPins.irRx;
1142}
1143
1144/*********************************************************************
1145** Function: gsetRfTxPin

Callers 1

setupMethod · 0.85

Calls 3

setIrRxPinMethod · 0.80
loopOptionsFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected