Skip to content

Commit

Permalink
Range function fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger authored and pascallanger committed Jan 2, 2016
1 parent 282c48e commit c1454e4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
5 changes: 2 additions & 3 deletions Multiprotocol/A7105_SPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ void A7105_SetPower()
uint8_t power=A7105_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?A7105_HIGH_POWER:A7105_LOW_POWER;
else
if(IS_RANGE_FLAG_on)
power=A7105_POWER_0;
if(IS_RANGE_FLAG_on)
power=A7105_RANGE_POWER;
A7105_WriteReg(0x28, power);
}

Expand Down
5 changes: 2 additions & 3 deletions Multiprotocol/CC2500_SPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ void CC2500_SetPower()
uint8_t power=CC2500_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?CC2500_HIGH_POWER:CC2500_LOW_POWER;
else
if(IS_RANGE_FLAG_on)
power=CC2500_POWER_0;
if(IS_RANGE_FLAG_on)
power=CC2500_RANGE_POWER;
cc2500_writeReg(CC2500_3E_PATABLE, power);
}

Expand Down
5 changes: 2 additions & 3 deletions Multiprotocol/CYRF6936_SPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ void CYRF_SetPower(uint8_t val)
uint8_t power=CYRF_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?CYRF_HIGH_POWER:CYRF_LOW_POWER;
else
if(IS_RANGE_FLAG_on)
power=CYRF_POWER_0;
if(IS_RANGE_FLAG_on)
power=CYRF_RANGE_POWER;
CYRF_WriteRegister(CYRF_03_TX_CFG, val | power);
}

Expand Down
5 changes: 2 additions & 3 deletions Multiprotocol/NRF24l01_SPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ void NRF24L01_SetPower()
uint8_t power=NRF_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?NRF_HIGH_POWER:NRF_LOW_POWER;
else
if(IS_RANGE_FLAG_on)
power=NRF_POWER_0;
if(IS_RANGE_FLAG_on)
power=NRF_POWER_0;
rf_setup = (rf_setup & 0xF9) | (power << 1);
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, rf_setup);
}
Expand Down
10 changes: 7 additions & 3 deletions Multiprotocol/multiprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ enum A7105_POWER
#define A7105_HIGH_POWER A7105_POWER_5
#define A7105_LOW_POWER A7105_POWER_3
#define A7105_BIND_POWER A7105_POWER_0
#define A7105_RANGE_POWER A7105_POWER_0

// NRF Power
// Power setting is 0..3 for nRF24L01
Expand All @@ -242,6 +243,7 @@ enum NRF_POWER
#define NRF_HIGH_POWER NRF_POWER_2
#define NRF_LOW_POWER NRF_POWER_1
#define NRF_BIND_POWER NRF_POWER_0
#define NRF_RANGE_POWER NRF_POWER_0

// CC2500 power
enum CC2500_POWER
Expand All @@ -258,6 +260,7 @@ enum CC2500_POWER
#define CC2500_HIGH_POWER CC2500_POWER_6
#define CC2500_LOW_POWER CC2500_POWER_3
#define CC2500_BIND_POWER CC2500_POWER_0
#define CC2500_RANGE_POWER CC2500_POWER_0

// CYRF power
enum CYRF_POWER
Expand All @@ -271,9 +274,10 @@ enum CYRF_POWER
CYRF_POWER_6 = 0x06, //
CYRF_POWER_7 = 0x07 //
};
#define CYRF_HIGH_POWER 7
#define CYRF_LOW_POWER 3
#define CYRF_BIND_POWER 0
#define CYRF_HIGH_POWER CYRF_POWER_7
#define CYRF_LOW_POWER CYRF_POWER_3
#define CYRF_BIND_POWER CYRF_POWER_0
#define CYRF_RANGE_POWER CYRF_POWER_0

//*******************
//*** CRC Table ***
Expand Down

0 comments on commit c1454e4

Please sign in to comment.