SZS 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]
 
#define MAIN_TASK_SCH_CCAI   main_taskSchedule[1]
 
#define MAIN_TASK_SCH_NWK   main_taskSchedule[2]
 
#define MAIN_TASK_SCH_ADC   main_taskSchedule[3]
 
#define MAIN_TASK_SCH_UART   main_taskSchedule[4]
 
#define MAIN_TASK_SCH_LED   main_taskSchedule[5]
 
#define MAIN_TASK_SCH_BUT   main_taskSchedule[6]
 
#define MAIN_TASK_SCH_REP   main_taskSchedule[7]
 
#define MAIN_TASK_SCH_WDT   main_taskSchedule[8]
 
#define MAIN_TASK_COUNT   9
 
#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 120 of file main.c.

Referenced by main().

#define MAIN_TASK_COUNT   9

Number of tasks

Definition at line 115 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 142 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_taskSchedule, nwk_init(), nwk_process(), 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 255 of file main.c.

References clock_tick().

+ Here is the call graph for this function: