69 #include <ti/mcu/msp430/Grace.h>
104 #define MAIN_TASK_SCH_SPI main_taskSchedule[0]
105 #define MAIN_TASK_SCH_CCAI main_taskSchedule[1]
106 #define MAIN_TASK_SCH_NWK main_taskSchedule[2]
107 #define MAIN_TASK_SCH_PTPDR main_taskSchedule[3]
108 #define MAIN_TASK_SCH_PTP main_taskSchedule[4]
109 #define MAIN_TASK_SCH_ADC main_taskSchedule[5]
110 #define MAIN_TASK_SCH_UART main_taskSchedule[6]
111 #define MAIN_TASK_SCH_LED main_taskSchedule[7]
112 #define MAIN_TASK_SCH_BUT main_taskSchedule[8]
113 #define MAIN_TASK_SCH_REP main_taskSchedule[9]
114 #define MAIN_TASK_SCH_WDT main_taskSchedule[10]
118 #define MAIN_TASK_COUNT 11
123 #define MAIN_FLAG_WDT_BIT 1
146 UInt16 main_runCounter = 0;
147 Uint8 main_flags = 0;
245 WDTCTL = WDTPW | WDTCNTCL | WDTSSEL;
249 __bis_SR_register(LPM3_bits + GIE);
267 static Uint8 main_timerCount = 0;
269 __disable_interrupt();
276 if (!(main_timerCount & 0x03)) {
280 __enable_interrupt();
UInt16 rep_proccess()
Report process.
Network functions interface.
#define MAIN_TASK_SCH_PTPDR
PTP delay request check task schedule.
UInt8 TMRB0_ISR()
Tiner B0 ISR.
Interruption management (enable/disable) interface.
void clock_tick()
Clock tick.
#define MAIN_TASK_SCH_UART
UART task schedule.
void adc_init()
This function initializes the ADC variables.
UInt16 uart_proccess()
UART process.
UInt16 ptp_process()
PTP process.
void ptp_init()
PTP initialization.
UInt16 led_proccess()
This function processes the tasks of the LED, it controls the red LED.
ADC10 connected sensors reading interface.
#define MAIN_TASK_SCH_PTP
PTP task schedule.
void main()
Main function of the program.
void rep_init()
Report initialization.
void clock_init()
Clock Initialization.
UInt8 uart_startFrame(UInt8 len, UInt8 cmd0, UInt8 cmd1)
Start frame.
UInt16 main_taskSchedule[MAIN_TASK_COUNT]
Task schedule for each task.
#define MAIN_TASK_SCH_NWK
Network task schedule.
void nwk_init()
Network initialization.
#define MAIN_TASK_SCH_ADC
ADC task schedule.
UInt16 ptp_processPDelayReq()
Process PDelayReq.
#define MAIN_TASK_SCH_LED
Led task schedule.
#define MAIN_TASK_SCH_CCAI
CC2480 task schedule.
#define MAIN_TASK_SCH_REP
Report task schedule.
#define MAIN_TASK_SCH_BUT
Button task schedule.
UInt16 nwk_process()
Network process.
#define MAIN_FLAG_WDT_BIT
void led_init()
LED Initialization.
UInt16 spi_proccess()
SPI proccess.
UInt8 uart_snd(UInt8 len, void *pBuf)
Send.
#define MAIN_TASK_SCH_SPI
SPI task schedule.
void rep_hello()
Hello message.
void ccai_init()
This function initializes the CC2480 Application Interface variables.
UInt16 ccai_proccess()
This function processes the tasks of the CC2480 Application Interface.
void uart_init()
UART initialization.
void uart_endFrame()
End frame.
void spi_init()
SPI initialization.
#define MAIN_TASK_SCH_WDT
Watch Dog task schedule.
UInt16 adc_proccess()
This function processes the tasks of the ADC.