SZSPTP ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
Main

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.
 

Detailed Description

Main C code file.

Macro Definition Documentation

#define MAIN_FLAG_WDT_BIT   1

Flag bit for indicator of reset caused by WDT+.

Definition at line 123 of file main.c.

Referenced by main().

#define MAIN_TASK_COUNT   11

Number of tasks

Definition at line 118 of file main.c.

Referenced by main().

Function Documentation

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().

+ Here is the call graph for this function:

UInt8 TMRB0_ISR ( )

Tiner B0 ISR.

Timer B Interrupt Service Request.

Returns
A boolean, 1 to exit LPM on end of IFG, 0 to do not change.

Definition at line 265 of file main.c.

References clock_tick().

+ Here is the call graph for this function: