Skip to content

Commit

Permalink
Disable the active RF receive when transmitting with RC-Switch and Ne…
Browse files Browse the repository at this point in the history
…wRemoteTransmitter\n

Pilight RF transmit is behaving this way already.
  • Loading branch information
peshovec committed Oct 8, 2024
1 parent 4f26d39 commit 23c4d5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/ZgatewayRF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ void XtoRF(const char* topicOri, JsonObject& RFdata) { // json object decoding
Log.notice(F("RF Protocol:%d" CR), valuePRT);
Log.notice(F("RF Pulse Lgth: %d" CR), valuePLSL);
Log.notice(F("Bits nb: %d" CR), valueBITS);
# ifdef ZradioCC1101
disableCurrentReceiver();
# ifdef ZradioCC1101
initCC1101();
int txPower = RFdata["txpower"] | RF_CC1101_TXPOWER;
ELECHOUSE_cc1101.setPA((int)txPower);
Expand Down
8 changes: 4 additions & 4 deletions main/ZgatewayRF2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void rf2Callback(unsigned int period, unsigned long address, unsigned long group

# if simpleReceiving
void XtoRF2(const char* topicOri, const char* datacallback) {
NewRemoteReceiver::disable();
disableCurrentReceiver();
pinMode(RF_EMITTER_GPIO, OUTPUT);
initCC1101();

Expand Down Expand Up @@ -235,8 +235,8 @@ void XtoRF2(const char* topicOri, const char* datacallback) {
}
# ifdef ZradioCC1101
ELECHOUSE_cc1101.SetRx(RFConfig.frequency); // set Receive on
NewRemoteReceiver::enable();
# endif
enableActiveReceiver();
}
# endif

Expand Down Expand Up @@ -266,7 +266,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding
valueUNIT = 0;
if (valuePERIOD == 0)
valuePERIOD = 272;
NewRemoteReceiver::disable();
disableCurrentReceiver();
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD, RF2_EMITTER_REPEAT);
Log.trace(F("Sending" CR));
if (valueGROUP) {
Expand All @@ -283,7 +283,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding
}
}
Log.notice(F("MQTTtoRF2 OK" CR));
NewRemoteReceiver::enable();
enableActiveReceiver();

success = true;
}
Expand Down

0 comments on commit 23c4d5f

Please sign in to comment.