summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon/src/main_avr.c
blob: 6c0cd3beea091c5c22d0c4f5d0f11329c3b777f2 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/**************************************************************************//**
\file Peer2Peer.c

\brief Peer-2-peer sample application.

\author
Atmel Corporation: http://www.atmel.com \n
Support email: avr@atmel.com

Copyright (c) 2008 , Atmel Corporation. All rights reserved.
Licensed under Atmel's Limited License Agreement (BitCloudTM).

\internal
History:
14.10.09 A. Taradov - Added FIFO for received packets
******************************************************************************/

/******************************************************************************
		Includes section
******************************************************************************/
// #include <types.h>
// #include <configServer.h>
// #include <appTimer.h>
// #include <zdo.h>
// #include <peer2peer.h>
// #include <network.h>
// #include <serialInterface.h>
// #include <irq.h>
// #include <sensors.h>
// #include <servo.h>
// #include <stdio.h>
// #include <debug.h>
// #include <position.h>
// #include <math.h>
/******************************************************************************
		Define(s) section
******************************************************************************/

/******************************************************************************
		Variables section
******************************************************************************/

// Application related parameters
// AppState_t appState = APP_INITIAL_STATE;  // application state
// int jack = 0;
// status_s status;
// extern int lost_packet;
// extern unsigned int angle;
/***********************************************************************************
		Static functions declarations section
***********************************************************************************/
// extern APS_DataReq_t test;
// extern buff_t buf_to_send;

/***********************************************************************************
		Implementation section
***********************************************************************************/
/**************************************************************************//**
\brief Application task handler.

\param  none.
\return none.
******************************************************************************/
// #ifdef TYPE_COOR
// 	DeviceType_t deviceType = DEVICE_TYPE_COORDINATOR;
// #else
//  	DeviceType_t deviceType = DEVICE_TYPE_END_DEVICE;
// #endif
// int top = 0;
// void APL_TaskHandler(void)
// {
// 	switch (appState)
// 	{
// 		case APP_INITIAL_STATE:                 // Node has initial state
// 			
// 			/*D5/D6/D7 are configured in output */
// 			DDRD = 0xE0;
// 			/* Power on the led */
// 			int temp=0;
// 			for(temp=0;temp<3;temp++)
// 			{
// 				PORTD=0xE0;
// 				_delay_ms(100);
// 				PORTD=0;
// 				_delay_ms(100);
// 			}
// 			
//  			initSerialInterface();          // Open USART
// 
// 			switch(deviceType)
// 			{
// 				case DEVICE_TYPE_COORDINATOR:
// // 					error = init_twi();
// 					initNetwork();
// 					break;
// 				case DEVICE_TYPE_END_DEVICE:
// 					init_ILS();
// 					control_motor_ms(100);
// 					init_timer_servo();
// 					initNetwork();
// 					break;
// 				default:
// 					break;
// 			}
// 			appState = APP_NETWORK_JOINING_STATE;
// 			SYS_PostTask(APL_TASK_ID);      // Execute next step
// 			break;
// 
// 		case APP_NETWORK_JOINING_STATE:
//    			startNetwork();
// 			break;
// 			
// 		case APP_NETWORK_LEAVING_STATE:
// 			break;
// 		case APP_NETWORK_JOINED_STATE:
// 			if(jack == 1)
// 			{
// 				send_angle(angle);
// 			}
// 			break;
// 		default:
// 			break;
// 	}
// }
// 


/**************************************************************************//**
\brief Wakeup event handler (dummy).

\param  none.
\return none.
******************************************************************************/
// void ZDO_WakeUpInd(void)
// {
// }


#ifdef _BINDING_
/***********************************************************************************
Stub for ZDO Binding Indication

Parameters:
bindInd - indication

Return:
none

***********************************************************************************/
// void ZDO_BindIndication(ZDO_BindInd_t *bindInd) 
// {
// (void)bindInd;
// }

/***********************************************************************************
Stub for ZDO Unbinding Indication

Parameters:
unbindInd - indication

Return:
none

***********************************************************************************/
// void ZDO_UnbindIndication(ZDO_UnbindInd_t *unbindInd)
// {
// (void)unbindInd;
// }
#endif //_BINDING_

/**********************************************************************//**
\brief Main - C program main start function

\param none
\return none
**************************************************************************/
int main(void)
{ 
//    	init_timer3();
// 	SYS_SysInit();
//  	init_struct();
// 	for(;;)
// 	{
//  		SYS_RunTask();
// 	}
}
// eof peer2Peer.c