Rev 744 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
426 | killagreg | 1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // + Copyright (c) 04.2007 Holger Buss |
||
3 | // + only for non-profit use |
||
4 | // + www.MikroKopter.com |
||
5 | // + see the File "License.txt" for further Informations |
||
6 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
7 | |||
8 | #include <avr/io.h> |
||
9 | #include <avr/interrupt.h> |
||
434 | killagreg | 10 | #include <avr/pgmspace.h> |
426 | killagreg | 11 | #include <avr/wdt.h> |
12 | #include <stdarg.h> |
||
13 | #include <string.h> |
||
14 | |||
15 | #include "main.h" |
||
16 | #include "menu.h" |
||
17 | #include "timer0.h" |
||
18 | #include "uart0.h" |
||
19 | #include "ubx.h" |
||
436 | killagreg | 20 | #include "printf_P.h" |
426 | killagreg | 21 | |
22 | |||
23 | #define FC_ADDRESS 1 |
||
24 | #define NC_ADDRESS 2 |
||
25 | #define MK3MAG_ADDRESS 3 |
||
26 | |||
27 | #define FM_ADDRESS 10 // FOLLOW ME |
||
28 | |||
29 | #define FALSE 0 |
||
30 | #define TRUE 1 |
||
31 | |||
32 | |||
33 | //int8_t test __attribute__ ((section (".noinit"))); |
||
34 | uint8_t Request_VerInfo = FALSE; |
||
35 | uint8_t Request_Display = FALSE; |
||
36 | uint8_t Request_Display1 = FALSE; |
||
37 | uint8_t Request_ExternalControl = FALSE; |
||
38 | uint8_t Request_DebugData = FALSE; |
||
39 | uint8_t Request_DebugLabel = 255; |
||
40 | uint8_t Request_SendFollowMe = FALSE; |
||
41 | uint8_t DisplayLine = 0; |
||
42 | |||
43 | volatile uint8_t txd_buffer[TXD_BUFFER_LEN]; |
||
44 | volatile uint8_t rxd_buffer_locked = FALSE; |
||
45 | volatile uint8_t rxd_buffer[RXD_BUFFER_LEN]; |
||
46 | volatile uint8_t txd_complete = TRUE; |
||
47 | volatile uint8_t ReceivedBytes = 0; |
||
48 | volatile uint8_t *pRxData = 0; |
||
49 | volatile uint8_t RxDataLen = 0; |
||
50 | |||
51 | uint8_t PcAccess = 100; |
||
52 | |||
53 | ExternControl_t ExternControl; |
||
54 | DebugOut_t DebugOut; |
||
55 | UART_VersionInfo_t UART_VersionInfo; |
||
56 | |||
57 | uint16_t DebugData_Timer; |
||
434 | killagreg | 58 | uint16_t DebugData_Interval = 0; // in 1ms |
759 | woggle | 59 | uint16_t Display_Timer; |
744 | woggle | 60 | uint16_t Display_Interval = 0; // in 1 ms |
426 | killagreg | 61 | |
62 | Waypoint_t FollowMe; |
||
63 | |||
434 | killagreg | 64 | // keep lables in flash to save 512 bytes of sram space |
65 | const prog_uint8_t ANALOG_LABEL[32][16] = |
||
426 | killagreg | 66 | { |
67 | //1234567890123456 |
||
68 | "Analog_Ch0 ", //0 |
||
69 | "Analog_Ch1 ", |
||
70 | "Analog_Ch2 ", |
||
71 | "Analog_Ch3 ", |
||
72 | "Analog_Ch4 ", |
||
73 | "Analog_Ch5 ", //5 |
||
74 | "Analog_Ch6 ", |
||
75 | "Analog_Ch7 ", |
||
76 | "UBat ", |
||
436 | killagreg | 77 | "SysState ", |
78 | "Debug10 ", //10 |
||
79 | "Debug11 ", |
||
80 | "Debug12 ", |
||
81 | "Debug13 ", |
||
82 | "Debug14 ", |
||
83 | "Debug15 ", //15 |
||
426 | killagreg | 84 | "Zellenzahl ", |
85 | "PowerOn ", |
||
86 | "Debug18 ", |
||
87 | "Debug19 ", |
||
88 | "Debug20 ", //20 |
||
89 | "Debug21 ", |
||
90 | "Debug22 ", |
||
91 | "Debug23 ", |
||
92 | "Debug24 ", |
||
93 | "Debug25 ", //25 |
||
94 | "Debug26 ", |
||
95 | "Debug27 ", |
||
96 | "Debug28 ", |
||
97 | "Debug29 ", |
||
98 | "Debug30 ", //30 |
||
99 | "Debug31 " |
||
100 | }; |
||
101 | |||
102 | |||
103 | |||
104 | /****************************************************************/ |
||
105 | /* Initialization of the USART0 */ |
||
106 | /****************************************************************/ |
||
107 | void USART0_Init (void) |
||
108 | { |
||
109 | uint8_t sreg = SREG; |
||
110 | uint16_t ubrr = (uint16_t) ((uint32_t) SYSCLK/(8 * USART0_BAUD) - 1); |
||
111 | |||
112 | // disable all interrupts before configuration |
||
113 | cli(); |
||
114 | |||
115 | // disable RX-Interrupt |
||
116 | UCSR0B &= ~(1 << RXCIE0); |
||
117 | // disable TX-Interrupt |
||
118 | UCSR0B &= ~(1 << TXCIE0); |
||
119 | |||
120 | // set direction of RXD0 and TXD0 pins |
||
121 | // set RXD0 (PD0) as an input pin |
||
122 | PORTD |= (1 << PORTD0); |
||
123 | DDRD &= ~(1 << DDD0); |
||
124 | // set TXD0 (PD1) as an output pin |
||
125 | PORTD |= (1 << PORTD1); |
||
126 | DDRD |= (1 << DDD1); |
||
127 | |||
128 | // USART0 Baud Rate Register |
||
129 | // set clock divider |
||
130 | UBRR0H = (uint8_t)(ubrr >> 8); |
||
131 | UBRR0L = (uint8_t)ubrr; |
||
132 | |||
133 | // USART0 Control and Status Register A, B, C |
||
134 | |||
135 | // enable double speed operation in |
||
136 | UCSR0A |= (1 << U2X0); |
||
137 | // enable receiver and transmitter in |
||
138 | UCSR0B = (1 << TXEN0) | (1 << RXEN0); |
||
139 | // set asynchronous mode |
||
140 | UCSR0C &= ~(1 << UMSEL01); |
||
141 | UCSR0C &= ~(1 << UMSEL00); |
||
142 | // no parity |
||
143 | UCSR0C &= ~(1 << UPM01); |
||
144 | UCSR0C &= ~(1 << UPM00); |
||
145 | // 1 stop bit |
||
146 | UCSR0C &= ~(1 << USBS0); |
||
147 | // 8-bit |
||
148 | UCSR0B &= ~(1 << UCSZ02); |
||
149 | UCSR0C |= (1 << UCSZ01); |
||
150 | UCSR0C |= (1 << UCSZ00); |
||
151 | |||
152 | // flush receive buffer |
||
153 | while ( UCSR0A & (1<<RXC0) ) UDR0; |
||
154 | |||
155 | // enable interrupts at the end |
||
156 | // enable RX-Interrupt |
||
157 | UCSR0B |= (1 << RXCIE0); |
||
158 | // enable TX-Interrupt |
||
159 | UCSR0B |= (1 << TXCIE0); |
||
160 | |||
161 | // initialize the debug timer |
||
162 | DebugData_Timer = SetDelay(DebugData_Interval); |
||
163 | |||
164 | // unlock rxd_buffer |
||
165 | rxd_buffer_locked = FALSE; |
||
166 | pRxData = 0; |
||
167 | RxDataLen = 0; |
||
168 | |||
169 | // no bytes to send |
||
170 | txd_complete = TRUE; |
||
171 | |||
172 | UART_VersionInfo.SWMajor = VERSION_MAJOR; |
||
173 | UART_VersionInfo.SWMinor = VERSION_MINOR; |
||
174 | UART_VersionInfo.SWPatch = VERSION_PATCH; |
||
175 | UART_VersionInfo.ProtoMajor = VERSION_SERIAL_MAJOR; |
||
176 | UART_VersionInfo.ProtoMinor = VERSION_SERIAL_MINOR; |
||
177 | |||
178 | // restore global interrupt flags |
||
179 | SREG = sreg; |
||
434 | killagreg | 180 | sei(); |
181 | printf("\r\n UART0 init...ok"); |
||
426 | killagreg | 182 | } |
183 | |||
184 | /****************************************************************/ |
||
185 | /* USART0 transmitter ISR */ |
||
186 | /****************************************************************/ |
||
187 | ISR(USART0_TX_vect) |
||
188 | { |
||
189 | static uint16_t ptr_txd_buffer = 0; |
||
190 | uint8_t tmp_tx; |
||
191 | if(!txd_complete) // transmission not completed |
||
192 | { |
||
193 | ptr_txd_buffer++; // die [0] wurde schon gesendet |
||
194 | tmp_tx = txd_buffer[ptr_txd_buffer]; |
||
195 | // if terminating character or end of txd buffer was reached |
||
196 | if((tmp_tx == '\r') || (ptr_txd_buffer == TXD_BUFFER_LEN)) |
||
197 | { |
||
198 | ptr_txd_buffer = 0; // reset txd pointer |
||
199 | txd_complete = 1; // stop transmission |
||
200 | } |
||
201 | UDR0 = tmp_tx; // send current byte will trigger this ISR again |
||
202 | } |
||
203 | // transmission completed |
||
204 | else ptr_txd_buffer = 0; |
||
205 | } |
||
206 | |||
207 | /****************************************************************/ |
||
208 | /* USART0 receiver ISR */ |
||
209 | /****************************************************************/ |
||
210 | ISR(USART0_RX_vect) |
||
211 | { |
||
212 | static uint16_t crc; |
||
213 | static uint8_t ptr_rxd_buffer = 0; |
||
214 | uint8_t crc1, crc2; |
||
215 | uint8_t c; |
||
216 | |||
217 | c = UDR0; // catch the received byte |
||
218 | |||
219 | if(rxd_buffer_locked) return; // if rxd buffer is locked immediately return |
||
220 | |||
221 | // the rxd buffer is unlocked |
||
222 | if((ptr_rxd_buffer == 0) && (c == '#')) // if rxd buffer is empty and syncronisation character is received |
||
223 | { |
||
224 | rxd_buffer[ptr_rxd_buffer++] = c; // copy 1st byte to buffer |
||
225 | crc = c; // init crc |
||
226 | } |
||
227 | #if 0 |
||
228 | else if (ptr_rxd_buffer == 1) // handle address |
||
229 | { |
||
230 | rxd_buffer[ptr_rxd_buffer++] = c; // copy byte to rxd buffer |
||
231 | crc += c; // update crc |
||
232 | } |
||
233 | #endif |
||
234 | else if (ptr_rxd_buffer < RXD_BUFFER_LEN) // collect incomming bytes |
||
235 | { |
||
236 | if(c != '\r') // no termination character |
||
237 | { |
||
238 | rxd_buffer[ptr_rxd_buffer++] = c; // copy byte to rxd buffer |
||
239 | crc += c; // update crc |
||
240 | } |
||
241 | else // termination character was received |
||
242 | { |
||
243 | // the last 2 bytes are no subject for checksum calculation |
||
244 | // they are the checksum itself |
||
245 | crc -= rxd_buffer[ptr_rxd_buffer-2]; |
||
246 | crc -= rxd_buffer[ptr_rxd_buffer-1]; |
||
247 | // calculate checksum from transmitted data |
||
248 | crc %= 4096; |
||
249 | crc1 = '=' + crc / 64; |
||
250 | crc2 = '=' + crc % 64; |
||
251 | // compare checksum to transmitted checksum bytes |
||
252 | if((crc1 == rxd_buffer[ptr_rxd_buffer-2]) && (crc2 == rxd_buffer[ptr_rxd_buffer-1])) |
||
253 | { // checksum valid |
||
254 | rxd_buffer[ptr_rxd_buffer] = '\r'; // set termination character |
||
255 | ReceivedBytes = ptr_rxd_buffer + 1;// store number of received bytes |
||
256 | rxd_buffer_locked = TRUE; // lock the rxd buffer |
||
257 | // if 2nd byte is an 'R' enable watchdog that will result in an reset |
||
258 | if(rxd_buffer[2] == 'R') {wdt_enable(WDTO_250MS);} // Reset-Commando |
||
259 | } |
||
260 | else |
||
261 | { // checksum invalid |
||
262 | rxd_buffer_locked = FALSE; // unlock rxd buffer |
||
263 | } |
||
264 | ptr_rxd_buffer = 0; // reset rxd buffer pointer |
||
265 | } |
||
266 | } |
||
267 | else // rxd buffer overrun |
||
268 | { |
||
269 | ptr_rxd_buffer = 0; // reset rxd buffer |
||
270 | rxd_buffer_locked = FALSE; // unlock rxd buffer |
||
271 | } |
||
272 | |||
273 | } |
||
274 | |||
275 | |||
276 | // -------------------------------------------------------------------------- |
||
277 | void AddCRC(uint16_t datalen) |
||
278 | { |
||
279 | uint16_t tmpCRC = 0, i; |
||
280 | for(i = 0; i < datalen; i++) |
||
281 | { |
||
282 | tmpCRC += txd_buffer[i]; |
||
283 | } |
||
284 | tmpCRC %= 4096; |
||
285 | txd_buffer[i++] = '=' + tmpCRC / 64; |
||
286 | txd_buffer[i++] = '=' + tmpCRC % 64; |
||
287 | txd_buffer[i++] = '\r'; |
||
288 | txd_complete = FALSE; |
||
289 | UDR0 = txd_buffer[0]; // initiates the transmittion (continued in the TXD ISR) |
||
290 | } |
||
291 | |||
292 | |||
293 | |||
294 | // -------------------------------------------------------------------------- |
||
295 | void SendOutData(uint8_t cmd, uint8_t addr, uint8_t numofbuffers, ...) // uint8_t *pdata, uint8_t len, ... |
||
296 | { |
||
297 | va_list ap; |
||
298 | uint16_t pt = 0; |
||
299 | uint8_t a,b,c; |
||
300 | uint8_t ptr = 0; |
||
301 | |||
302 | uint8_t *pdata = 0; |
||
303 | int len = 0; |
||
304 | |||
305 | txd_buffer[pt++] = '#'; // Start character |
||
306 | txd_buffer[pt++] = 'a' + addr; // Address (a=0; b=1,...) |
||
307 | txd_buffer[pt++] = cmd; // Command |
||
308 | |||
309 | va_start(ap, numofbuffers); |
||
310 | if(numofbuffers) |
||
311 | { |
||
312 | pdata = va_arg(ap, uint8_t*); |
||
313 | len = va_arg(ap, int); |
||
314 | ptr = 0; |
||
315 | numofbuffers--; |
||
316 | } |
||
317 | |||
318 | while(len) |
||
319 | { |
||
320 | if(len) |
||
321 | { |
||
322 | a = pdata[ptr++]; |
||
323 | len--; |
||
324 | if((!len) && numofbuffers) |
||
325 | { |
||
326 | pdata = va_arg(ap, uint8_t*); |
||
327 | len = va_arg(ap, int); |
||
328 | ptr = 0; |
||
329 | numofbuffers--; |
||
330 | } |
||
331 | } |
||
332 | else a = 0; |
||
333 | if(len) |
||
334 | { |
||
335 | b = pdata[ptr++]; |
||
336 | len--; |
||
337 | if((!len) && numofbuffers) |
||
338 | { |
||
339 | pdata = va_arg(ap, uint8_t*); |
||
340 | len = va_arg(ap, int); |
||
341 | ptr = 0; |
||
342 | numofbuffers--; |
||
343 | } |
||
344 | } |
||
345 | else b = 0; |
||
346 | if(len) |
||
347 | { |
||
348 | c = pdata[ptr++]; |
||
349 | len--; |
||
350 | if((!len) && numofbuffers) |
||
351 | { |
||
352 | pdata = va_arg(ap, uint8_t*); |
||
353 | len = va_arg(ap, int); |
||
354 | ptr = 0; |
||
355 | numofbuffers--; |
||
356 | } |
||
357 | } |
||
358 | else c = 0; |
||
359 | txd_buffer[pt++] = '=' + (a >> 2); |
||
360 | txd_buffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
||
361 | txd_buffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
||
362 | txd_buffer[pt++] = '=' + ( c & 0x3f); |
||
363 | } |
||
364 | va_end(ap); |
||
365 | AddCRC(pt); // add checksum after data block and initates the transmission |
||
366 | } |
||
367 | |||
368 | |||
369 | // -------------------------------------------------------------------------- |
||
370 | void Decode64(void) |
||
371 | { |
||
372 | uint8_t a,b,c,d; |
||
373 | uint8_t x,y,z; |
||
374 | uint8_t ptrIn = 3; |
||
375 | uint8_t ptrOut = 3; |
||
376 | uint8_t len = ReceivedBytes - 6; |
||
377 | |||
378 | while(len) |
||
379 | { |
||
380 | a = rxd_buffer[ptrIn++] - '='; |
||
381 | b = rxd_buffer[ptrIn++] - '='; |
||
382 | c = rxd_buffer[ptrIn++] - '='; |
||
383 | d = rxd_buffer[ptrIn++] - '='; |
||
384 | //if(ptrIn > ReceivedBytes - 3) break; |
||
385 | |||
386 | x = (a << 2) | (b >> 4); |
||
387 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
388 | z = ((c & 0x03) << 6) | d; |
||
389 | |||
390 | if(len--) rxd_buffer[ptrOut++] = x; else break; |
||
391 | if(len--) rxd_buffer[ptrOut++] = y; else break; |
||
392 | if(len--) rxd_buffer[ptrOut++] = z; else break; |
||
393 | } |
||
394 | pRxData = &rxd_buffer[3]; |
||
395 | RxDataLen = ptrOut - 3; |
||
396 | } |
||
397 | |||
398 | |||
399 | // -------------------------------------------------------------------------- |
||
400 | void USART0_ProcessRxData(void) |
||
401 | { |
||
402 | // if data in the rxd buffer are not locked immediately return |
||
403 | if(!rxd_buffer_locked) return; |
||
404 | |||
405 | Decode64(); // decode data block in rxd_buffer |
||
406 | |||
407 | |||
408 | switch(rxd_buffer[1] - 'a') |
||
409 | { |
||
410 | case FM_ADDRESS: |
||
411 | |||
412 | switch(rxd_buffer[2]) |
||
413 | { |
||
414 | default: |
||
415 | //unsupported command received |
||
416 | break; |
||
417 | } // case FC_ADDRESS: |
||
418 | |||
419 | default: // any Slave Address |
||
420 | |||
421 | switch(rxd_buffer[2]) |
||
422 | { |
||
423 | case 'a':// request for labels of the analog debug outputs |
||
424 | Request_DebugLabel = pRxData[0]; |
||
425 | if(Request_DebugLabel > 31) Request_DebugLabel = 31; |
||
426 | PcAccess = 255; |
||
427 | break; |
||
428 | |||
429 | case 'h':// request for display columns |
||
430 | PcAccess = 255; |
||
744 | woggle | 431 | if((pRxData[0] & 0x80) == 0x00) // old format |
432 | { |
||
433 | DisplayLine = 2; |
||
434 | Display_Interval = 0; |
||
435 | } |
||
436 | else // new format |
||
437 | { |
||
438 | RemoteKeys |= ~pRxData[0]; |
||
439 | Display_Interval = (unsigned int)pRxData[1] * 10; |
||
440 | DisplayLine = 4; |
||
441 | Request_Display = TRUE; |
||
442 | } |
||
426 | killagreg | 443 | break; |
444 | |||
445 | case 'l':// request for display columns |
||
446 | PcAccess = 255; |
||
447 | MenuItem = pRxData[0]; |
||
448 | Request_Display1 = TRUE; |
||
449 | break; |
||
450 | |||
451 | case 'v': // request for version and board release |
||
452 | Request_VerInfo = TRUE; |
||
453 | break; |
||
454 | |||
455 | case 'd': // request for the debug data |
||
456 | DebugData_Interval = (uint16_t) pRxData[0] * 10; |
||
457 | if(DebugData_Interval > 0) Request_DebugData = TRUE; |
||
458 | break; |
||
459 | |||
460 | case 'g':// get external control data |
||
461 | Request_ExternalControl = TRUE; |
||
462 | break; |
||
463 | |||
464 | default: |
||
465 | //unsupported command received |
||
466 | break; |
||
467 | } |
||
468 | break; // default: |
||
469 | } |
||
470 | // unlock the rxd buffer after processing |
||
471 | pRxData = 0; |
||
472 | RxDataLen = 0; |
||
473 | rxd_buffer_locked = FALSE; |
||
474 | } |
||
475 | |||
476 | //############################################################################ |
||
477 | //Routine für die Serielle Ausgabe |
||
478 | int16_t uart_putchar (int8_t c) |
||
479 | //############################################################################ |
||
480 | { |
||
481 | if (c == '\n') |
||
482 | uart_putchar('\r'); |
||
483 | // wait until previous character was send |
||
484 | loop_until_bit_is_set(UCSR0A, UDRE0); |
||
485 | // send character |
||
486 | UDR0 = c; |
||
487 | return (0); |
||
488 | } |
||
489 | |||
490 | |||
491 | //--------------------------------------------------------------------------------------------- |
||
492 | void USART0_TransmitTxData(void) |
||
493 | { |
||
494 | if(!txd_complete) return; |
||
495 | |||
496 | if(Request_VerInfo && txd_complete) |
||
497 | { |
||
498 | SendOutData('V', FM_ADDRESS, 1, (uint8_t *) &UART_VersionInfo, sizeof(UART_VersionInfo)); |
||
499 | Request_VerInfo = FALSE; |
||
500 | } |
||
759 | woggle | 501 | if( ((Display_Interval && CheckDelay(Display_Timer)) || Request_Display) && txd_complete) |
426 | killagreg | 502 | { |
744 | woggle | 503 | if(DisplayLine > 3)// new format |
504 | { |
||
505 | LCD_PrintMenu(); |
||
506 | SendOutData('H', FM_ADDRESS, 1, (uint8_t *)DisplayBuff, 80); |
||
507 | } |
||
508 | else // old format |
||
509 | { |
||
510 | LCD_printfxy(0,0,"!!! INCOMPATIBLE !!!"); |
||
511 | SendOutData('H', FC_ADDRESS, 2, &DisplayLine, sizeof(DisplayLine), (uint8_t *)DisplayBuff, 20); |
||
512 | if(DisplayLine++ > 3) DisplayLine = 0; |
||
513 | } |
||
759 | woggle | 514 | Display_Timer = SetDelay(Display_Interval); |
426 | killagreg | 515 | Request_Display = FALSE; |
516 | } |
||
517 | if(Request_Display1 && txd_complete) |
||
518 | { |
||
519 | LCD_PrintMenu(); |
||
520 | SendOutData('L', FM_ADDRESS, 3, &MenuItem, sizeof(MenuItem), &MaxMenuItem, sizeof(MaxMenuItem), DisplayBuff, sizeof(DisplayBuff)); |
||
521 | Request_Display1 = FALSE; |
||
522 | } |
||
523 | if(Request_DebugLabel != 0xFF) // Texte für die Analogdaten |
||
524 | { |
||
434 | killagreg | 525 | uint8_t label[16]; // local sram buffer |
526 | memcpy_P(label, ANALOG_LABEL[Request_DebugLabel], 16); // read lable from flash to sram buffer |
||
527 | SendOutData('A', FM_ADDRESS, 2, (uint8_t *) &Request_DebugLabel, sizeof(Request_DebugLabel), label, 16); |
||
426 | killagreg | 528 | Request_DebugLabel = 0xFF; |
529 | } |
||
530 | if(Request_ExternalControl && txd_complete) |
||
531 | { |
||
532 | SendOutData('G', FM_ADDRESS, 1,(uint8_t *) &ExternControl, sizeof(ExternControl)); |
||
533 | Request_ExternalControl = FALSE; |
||
534 | } |
||
535 | if( ((DebugData_Interval && CheckDelay(DebugData_Timer)) || Request_DebugData) && txd_complete) |
||
536 | { |
||
537 | SendOutData('D', FM_ADDRESS, 1,(uint8_t *) &DebugOut, sizeof(DebugOut)); |
||
538 | DebugData_Timer = SetDelay(DebugData_Interval); |
||
539 | Request_DebugData = FALSE; |
||
540 | } |
||
541 | if(Request_SendFollowMe && txd_complete) |
||
542 | { |
||
543 | SendOutData('s', NC_ADDRESS, 1, (uint8_t *)&FollowMe, sizeof(FollowMe)); |
||
544 | FollowMe.Position.Status = PROCESSED; |
||
545 | Request_SendFollowMe = FALSE; |
||
546 | } |
||
547 | } |
||
548 |