Skip to content
Open
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
12 changes: 6 additions & 6 deletions RCSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum {
numProto = sizeof(proto) / sizeof(proto[0])
};

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
volatile unsigned long RCSwitch::nReceivedValue = 0;
volatile unsigned int RCSwitch::nReceivedBitlength = 0;
volatile unsigned int RCSwitch::nReceivedDelay = 0;
Expand All @@ -102,7 +102,7 @@ RCSwitch::RCSwitch() {
this->nTransmitterPin = -1;
this->setRepeatTransmit(10);
this->setProtocol(1);
#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
this->nReceiverInterrupt = -1;
this->setReceiveTolerance(60);
RCSwitch::nReceivedValue = 0;
Expand Down Expand Up @@ -156,7 +156,7 @@ void RCSwitch::setRepeatTransmit(int nRepeatTransmit) {
/**
* Set Receiving Tolerance
*/
#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
void RCSwitch::setReceiveTolerance(int nPercent) {
RCSwitch::nReceiveTolerance = nPercent;
}
Expand Down Expand Up @@ -487,7 +487,7 @@ void RCSwitch::send(unsigned long code, unsigned int length) {
if (this->nTransmitterPin == -1)
return;

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
// make sure the receiver is disabled while we transmit
int nReceiverInterrupt_backup = nReceiverInterrupt;
if (nReceiverInterrupt_backup != -1) {
Expand All @@ -505,7 +505,7 @@ void RCSwitch::send(unsigned long code, unsigned int length) {
this->transmit(protocol.syncFactor);
}

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
// enable receiver again if we just disabled it
if (nReceiverInterrupt_backup != -1) {
this->enableReceive(nReceiverInterrupt_backup);
Expand All @@ -527,7 +527,7 @@ void RCSwitch::transmit(HighLow pulses) {
}


#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
/**
* Enable receiving data
*/
Expand Down
10 changes: 5 additions & 5 deletions RCSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
// At least for the ATTiny X4/X5, receiving has to be disabled due to
// missing libm depencies (udivmodhi4)
#if defined( __AVR_ATtinyX5__ ) or defined ( __AVR_ATtinyX4__ )
#define RCSwitchDisableReceiving
#ifndef RCSwitchDisableReceiving
#endif

// Number of maximum high/Low changes per packet.
Expand All @@ -80,7 +80,7 @@ class RCSwitch {
void send(unsigned long code, unsigned int length);
void send(const char* sCodeWord);

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
void enableReceive(int interrupt);
void enableReceive();
void disableReceive();
Expand All @@ -98,7 +98,7 @@ class RCSwitch {
void disableTransmit();
void setPulseLength(int nPulseLength);
void setRepeatTransmit(int nRepeatTransmit);
#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
void setReceiveTolerance(int nPercent);
#endif

Expand Down Expand Up @@ -155,7 +155,7 @@ class RCSwitch {
char* getCodeWordD(char group, int nDevice, bool bStatus);
void transmit(HighLow pulses);

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
static void handleInterrupt();
static bool receiveProtocol(const int p, unsigned int changeCount);
int nReceiverInterrupt;
Expand All @@ -165,7 +165,7 @@ class RCSwitch {

Protocol protocol;

#if not defined( RCSwitchDisableReceiving )
#ifndef RCSwitchDisableReceiving
static int nReceiveTolerance;
volatile static unsigned long nReceivedValue;
volatile static unsigned int nReceivedBitlength;
Expand Down