Skip to content

Commit

Permalink
Added #define to get read of RawSignal.Multiply
Browse files Browse the repository at this point in the history
  • Loading branch information
couin3 committed Apr 9, 2020
1 parent e41153e commit 28e08cc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions RFLink/Plugins/Plugin_044.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@
* Sample:
* 20;C2;DEBUG;Pulses=82;Pulses(uSec)=475,3850,450,1700,450,3825,450,3900,450,3725,450,3825,450,3825,450,3900,450,3725,450,1700,450,1700,450,3900,450,3725,450,1700,450,1700,450,1800,450,1625,450,3800,450,3825,450,1800,450,1625,450,1700,450,1700,450,1800,450,3725,450,3800,450,1700,450,1800,450,1625,450,3825,450,1700,450,3900,450,1625,450,1700,450,1700,450,3900,450,1625,450,1700,450,1700,450,3825,500;
\*********************************************************************************************/
#define AURIOLV3_PLUGIN_ID 44
#define AURIOLV3_PULSECOUNT 82

#define AURIOLV3_MIDHI 650 / RAWSIGNAL_SAMPLE_RATE

#define AURIOLV3_PULSEMIN 1500 / RAWSIGNAL_SAMPLE_RATE
#define AURIOLV3_PULSEMINMAX 2000 / RAWSIGNAL_SAMPLE_RATE
#define AURIOLV3_PULSEMAXMIN 3500 / RAWSIGNAL_SAMPLE_RATE

#ifdef PLUGIN_044
#include "../4_Misc.h"

Expand All @@ -56,35 +63,31 @@ boolean Plugin_044(byte function, char *string)
//==================================================================================
for (byte x = 2; x < AURIOLV3_PULSECOUNT; x += 2)
{
if (RawSignal.Pulses[x + 1] * RawSignal.Multiply > 650)
if (RawSignal.Pulses[x + 1] * RawSignal.Multiply > AURIOLV3_MIDHI)
return false;
if (RawSignal.Pulses[x] * RawSignal.Multiply > 3500)
if (RawSignal.Pulses[x] > AURIOLV3_PULSEMAXMIN)
{
if (bitcounter < 16)
{
bitstream1 = (bitstream1 << 1) | 0x1;
bitcounter++; // only need to count the first 10 bits
}
else
{
bitstream2 = (bitstream2 << 1) | 0x1;
}
}
else
{
if (RawSignal.Pulses[x] * RawSignal.Multiply > 2000)
if (RawSignal.Pulses[x] > AURIOLV3_PULSEMINMAX)
return false;
if (RawSignal.Pulses[x] * RawSignal.Multiply < 1500)
if (RawSignal.Pulses[x] < AURIOLV3_PULSEMIN)
return false;
if (bitcounter < 16)
{
bitstream1 = (bitstream1 << 1);
bitcounter++; // only need to count the first 10 bits
}
else
{
bitstream2 = (bitstream2 << 1);
}
}
}
//==================================================================================
Expand Down

0 comments on commit 28e08cc

Please sign in to comment.