Main C code file. More...
Files | |
file | main.c |
Program main file. | |
Macros | |
#define | MAIN_TASK_SCH_SPI main_taskSchedule[0] |
SPI task schedule. | |
#define | MAIN_TASK_SCH_CCAI main_taskSchedule[1] |
CC2480 task schedule. | |
#define | MAIN_TASK_SCH_NWK main_taskSchedule[2] |
Network task schedule. | |
#define | MAIN_TASK_SCH_PTPDR main_taskSchedule[3] |
PTP delay request check task schedule. | |
#define | MAIN_TASK_SCH_PTP main_taskSchedule[4] |
PTP task schedule. | |
#define | MAIN_TASK_SCH_ADC main_taskSchedule[5] |
ADC task schedule. | |
#define | MAIN_TASK_SCH_UART main_taskSchedule[6] |
UART task schedule. | |
#define | MAIN_TASK_SCH_LED main_taskSchedule[7] |
Led task schedule. | |
#define | MAIN_TASK_SCH_BUT main_taskSchedule[8] |
Button task schedule. | |
#define | MAIN_TASK_SCH_REP main_taskSchedule[9] |
Report task schedule. | |
#define | MAIN_TASK_SCH_WDT main_taskSchedule[10] |
Watch Dog task schedule. | |
#define | MAIN_TASK_COUNT 11 |
#define | MAIN_FLAG_WDT_BIT 1 |
Functions | |
void | main () |
Main function of the program. More... | |
UInt8 | TMRB0_ISR () |
Tiner B0 ISR. More... | |
Variables | |
UInt16 | main_taskSchedule [MAIN_TASK_COUNT] |
Task schedule for each task. | |
Main C code file.
#define MAIN_FLAG_WDT_BIT 1 |
#define MAIN_TASK_COUNT 11 |
void main | ( | ) |
Main function of the program.
The main function calls the initializations of each code unit and controls schedules for each task. After checking for scheduled tasks the micro controller is put on low power mode (LPM), after exiting LPM, there is a new check for scheduled tasks. The LPM exits each 1ms interval, but this may be delayed if the tasks combined takes more than 1ms. The delay is in units of ms. No schedules are lost, only delayed. The accuracy of the check period depends upon the oscillator.
Definition at line 145 of file main.c.
References adc_init(), adc_proccess(), but_init(), but_proccess(), ccai_init(), ccai_proccess(), clock_init(), led_init(), led_proccess(), MAIN_FLAG_WDT_BIT, MAIN_TASK_COUNT, MAIN_TASK_SCH_ADC, MAIN_TASK_SCH_BUT, MAIN_TASK_SCH_CCAI, MAIN_TASK_SCH_LED, MAIN_TASK_SCH_NWK, MAIN_TASK_SCH_PTP, MAIN_TASK_SCH_PTPDR, MAIN_TASK_SCH_REP, MAIN_TASK_SCH_SPI, MAIN_TASK_SCH_UART, MAIN_TASK_SCH_WDT, main_taskSchedule, nwk_init(), nwk_process(), ptp_init(), ptp_process(), ptp_processPDelayReq(), rep_hello(), rep_init(), rep_proccess(), spi_init(), spi_proccess(), uart_endFrame(), uart_init(), uart_proccess(), uart_snd(), and uart_startFrame().
UInt8 TMRB0_ISR | ( | ) |
Tiner B0 ISR.
Timer B Interrupt Service Request.
Definition at line 265 of file main.c.
References clock_tick().