-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
68 lines (59 loc) · 2.43 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/****************************************Copyright (c)****************************************************
**
**--------------File Info---------------------------------------------------------------------------------
** File name: main.c
** Descriptions: Main function for transciever prior loop
**
**--------------------------------------------------------------------------------------------------------
** Created by: LucasK
** Created date: 2012-04-18
** Version: v1.0
** Descriptions: The original version
**
**--------------------------------------------------------------------------------------------------------
** Modified by: LukasK
** Modified date:
** Version:
** Descriptions:
**
*********************************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include <reg9e5.h>
#include "global_init.h"
#include "RF_service.h"
#include "UART_service.h"
/* Defined constatnts --------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* External variables --------------------------------------------------------*/
/*******************************************************************************
* Function Name : main
* Description : Main loop
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
int main(void)
{
swap_data data_buffer = {0};
global_init(&data_buffer);
while(1)
{
if(is_radio_data_available() == TRUE) {
uart_disable_receiver();
radio_data_extraction(&data_buffer);
uart_enable_receiver();
radio_enable_receiver();
}
if(is_uart_data_available() == TRUE) {
radio_disable();
uart_data_extraction(&data_buffer);
uart_enable_receiver();
radio_enable_receiver();
}
}
return 0;
}
/*********************************************************************************************************
END OF FILE
*********************************************************************************************************/