Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RC_Green Drown RC_RX
Diff: nRF24L01P.cpp
- Revision:
- 5:d0c9b8b5cf75
- Parent:
- 4:756125f83a27
- Child:
- 6:a0e847d59312
diff -r 756125f83a27 -r d0c9b8b5cf75 nRF24L01P.cpp
--- a/nRF24L01P.cpp Tue Dec 10 00:55:49 2019 +0000
+++ b/nRF24L01P.cpp Tue Dec 10 02:01:33 2019 +0000
@@ -3,10 +3,28 @@
uint8_t NRF24L01_RXDATA[32];
uint8_t NRF24L01_TXDATA[32];
-static uint8_t TX_ADDRESS[5]= {0x00,0x00,0x00,0x00,0x08};
-static uint8_t RX_ADDRESS[5]= {0x00,0x00,0x00,0x00,0x08};
+uint8_t TX_ADDRESS[5]= {0x00,0x00,0x00,0x00,0x08};
+uint8_t RX_ADDRESS[5]= {0x00,0x00,0x00,0x00,0x08};
int Nrf_Erro=0;
int ledtick;
+int init_time=0;
+
+void nRF24L01P::powerUp(){}
+
+void nRF24L01P::setTransferSize(int TransSize ){}
+
+void nRF24L01P::setReceiveMode(){}
+
+void nRF24L01P::setRxAddress(int RxAdd)
+{
+ RX_ADDRESS[4]=RxAdd&0xFF;
+}
+void nRF24L01P::setTxAddress(int TxAdd)
+{
+ TX_ADDRESS[4]=TxAdd&0xFF;
+}
+void nRF24L01P::enable(){}
+
uint8_t nRF24L01P::NRF_Read_Reg(uint8_t reg)
{
@@ -140,6 +158,9 @@
}
void nRF24L01P::NRF24L01_Init(uint8_t Chanal,uint8_t Mode)
{
+ init_time++;
+ if(init_time>=3)
+ return;
ce_=0;
ledtick=0;
NRF_Write_Reg(FLUSH_TX,0xff);