forked from UrsusPilot/QuadCopterGroundStation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
51 lines (38 loc) · 805 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "stm32f4_system.h"
#include "main.h"
#include "stm32f4_delay.h"
#include "led.h"
#include "module_nrf24l01.h"
#include "module_rs232.h"
void System_Init(void)
{
SystemInit();
LED_Config();
//KEY_Config();
RS232_Config();
nRF24L01_Config();
Delay_10ms(2);
}
int main(void)
{
uint8_t Sta = ERROR;
uint8_t RxBuf[5][5] = {0};
System_Init();
printf("Rx mode test...\n\r");
/* nRF Check */
while(Sta == ERROR)
Sta = nRF_Check();
printf("Start ...\n\r");
printf("============");
/*Convert to Rx */
nRF_RX_Mode();
/*Receive the data from remote quadcopter */
while(1){
Sta = nRF_Rx_Data(RxBuf[0]);
printf("status = ");
if(Sta == RX_DR) {
// Transport_Recv(RxBuf[0]);
printf("receive ! ");
}
}
}