Disable nrf on lowpower-off
This commit is contained in:
parent
26515e2717
commit
d4c48f66c2
|
@ -11,6 +11,7 @@ void VoltageCheck(void){
|
|||
results /= 1024;
|
||||
|
||||
if( results < 3500 ){
|
||||
nrf_off();
|
||||
gpioSetValue (RB_PWR_GOOD, 0);
|
||||
gpioSetValue (RB_LCD_BL, 0);
|
||||
SCB_SCR |= SCB_SCR_SLEEPDEEP;
|
||||
|
|
|
@ -395,3 +395,10 @@ void nrf_init() {
|
|||
nrf_write_reg(R_RF_SETUP,DEFAULT_SPEED|R_RF_SETUP_RF_PWR_3);
|
||||
};
|
||||
|
||||
void nrf_off() {
|
||||
nrf_write_reg(R_CONFIG,
|
||||
R_CONFIG_MASK_RX_DR|
|
||||
R_CONFIG_MASK_TX_DS|
|
||||
R_CONFIG_MASK_MAX_RT
|
||||
); // Most important: no R_CONFIG_PWR_UP
|
||||
};
|
||||
|
|
|
@ -138,6 +138,7 @@ int nrf_rcv_pkt_time_encr(int maxtime, int maxsize, uint8_t * pkt, uint32_t cons
|
|||
char nrf_snd_pkt_crc_encr(int size, uint8_t * pkt, uint32_t const k[4]);
|
||||
|
||||
void nrf_init() ;
|
||||
void nrf_off() ;
|
||||
|
||||
void nrf_cmd(uint8_t cmd);
|
||||
uint8_t nrf_cmd_status(uint8_t cmd);
|
||||
|
|
Loading…
Reference in New Issue