Skip to content

Commit

Permalink
add volatile to nReceivedValue and some other member vars.
Browse files Browse the repository at this point in the history
See issue #119
  • Loading branch information
fingolfin committed Feb 27, 2017
1 parent 83a2236 commit f820d2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions RCSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ enum {
};

#if not defined( RCSwitchDisableReceiving )
unsigned long RCSwitch::nReceivedValue = 0;
unsigned int RCSwitch::nReceivedBitlength = 0;
unsigned int RCSwitch::nReceivedDelay = 0;
unsigned int RCSwitch::nReceivedProtocol = 0;
volatile unsigned long RCSwitch::nReceivedValue = 0;
volatile unsigned int RCSwitch::nReceivedBitlength = 0;
volatile unsigned int RCSwitch::nReceivedDelay = 0;
volatile unsigned int RCSwitch::nReceivedProtocol = 0;
int RCSwitch::nReceiveTolerance = 60;
const unsigned int RCSwitch::nSeparationLimit = 4300;
// separationLimit: minimum microseconds between received codes, closer codes are ignored.
Expand Down
8 changes: 4 additions & 4 deletions RCSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ class RCSwitch {

#if not defined( RCSwitchDisableReceiving )
static int nReceiveTolerance;
static unsigned long nReceivedValue;
static unsigned int nReceivedBitlength;
static unsigned int nReceivedDelay;
static unsigned int nReceivedProtocol;
volatile static unsigned long nReceivedValue;
volatile static unsigned int nReceivedBitlength;
volatile static unsigned int nReceivedDelay;
volatile static unsigned int nReceivedProtocol;
const static unsigned int nSeparationLimit;
/*
* timings[0] contains sync timing, followed by a number of bits
Expand Down

0 comments on commit f820d2e

Please sign in to comment.