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
16 changes: 9 additions & 7 deletions RCSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ static const RCSwitch::Protocol proto[] = {
#else
static const RCSwitch::Protocol PROGMEM proto[] = {
#endif
{ 350, { 1, 31 }, { 1, 3 }, { 3, 1 }, false }, // protocol 1
{ 650, { 1, 10 }, { 1, 2 }, { 2, 1 }, false }, // protocol 2
{ 100, { 30, 71 }, { 4, 11 }, { 9, 6 }, false }, // protocol 3
{ 380, { 1, 6 }, { 1, 3 }, { 3, 1 }, false }, // protocol 4
{ 500, { 6, 14 }, { 1, 2 }, { 2, 1 }, false }, // protocol 5
{ 450, { 23, 1 }, { 1, 2 }, { 2, 1 }, true } // protocol 6 (HT6P20B)
{ 350, { 1, 31 }, { 1, 3 }, { 3, 1 }, false, 0 }, // protocol 1
{ 650, { 1, 10 }, { 1, 2 }, { 2, 1 }, false, 0 }, // protocol 2
{ 100, { 30, 71 }, { 4, 11 }, { 9, 6 }, false, 0 }, // protocol 3
{ 380, { 1, 6 }, { 1, 3 }, { 3, 1 }, false, 0 }, // protocol 4
{ 500, { 6, 14 }, { 1, 2 }, { 2, 1 }, false, 0 }, // protocol 5
{ 450, { 23, 1 }, { 1, 2 }, { 2, 1 }, true, 0 }, // protocol 6 (HT6P20B)
{ 220, { 1, 46 }, { 1, 6 }, { 1, 1 }, false, 2 } // protocol 7 (NEXA)
};

enum {
Expand Down Expand Up @@ -625,7 +626,8 @@ bool RECEIVE_ATTR RCSwitch::receiveProtocol(const int p, unsigned int changeCoun
*
* The 2nd saved duration starts the data
*/
const unsigned int firstDataTiming = (pro.invertedSignal) ? (2) : (1);
const unsigned int firstDataTiming = (pro.invertedSignal) ? (2) : (1)
+ pro.skipPulses;

for (unsigned int i = firstDataTiming; i < changeCount - 1; i += 2) {
code <<= 1;
Expand Down
3 changes: 2 additions & 1 deletion RCSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

// Number of maximum High/Low changes per packet.
// We can handle up to (unsigned long) => 32 bit * 2 H/L changes per bit + 2 for sync
#define RCSWITCH_MAX_CHANGES 67
#define RCSWITCH_MAX_CHANGES 133

class RCSwitch {

Expand Down Expand Up @@ -114,6 +114,7 @@ class RCSwitch {
HighLow one;
/** @brief if true inverts the high and low logic levels in the HighLow structs */
bool invertedSignal;
int skipPulses;
};

void setProtocol(Protocol protocol);
Expand Down