Rev 426 | Rev 436 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 426 | Rev 434 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | // + see the File "License.txt" for further Informations |
5 | // + see the File "License.txt" for further Informations |
6 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
6 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Line 7... | Line 7... | ||
7 | 7 | ||
8 | #include <avr/io.h> |
8 | #include <avr/io.h> |
- | 9 | #include <avr/interrupt.h> |
|
9 | #include <avr/interrupt.h> |
10 | #include <avr/pgmspace.h> |
10 | #include <avr/wdt.h> |
11 | #include <avr/wdt.h> |
11 | #include <stdarg.h> |
12 | #include <stdarg.h> |
Line 12... | Line 13... | ||
12 | #include <string.h> |
13 | #include <string.h> |
Line 26... | Line 27... | ||
26 | #define FM_ADDRESS 10 // FOLLOW ME |
27 | #define FM_ADDRESS 10 // FOLLOW ME |
Line 27... | Line 28... | ||
27 | 28 | ||
28 | #define FALSE 0 |
29 | #define FALSE 0 |
Line 29... | Line -... | ||
29 | #define TRUE 1 |
- | |
Line 30... | Line 30... | ||
30 | 30 | #define TRUE 1 |
|
31 | uint8_t text[100]; // globally used text buffer |
31 | |
32 | 32 | ||
33 | //int8_t test __attribute__ ((section (".noinit"))); |
33 | //int8_t test __attribute__ ((section (".noinit"))); |
Line 53... | Line 53... | ||
53 | ExternControl_t ExternControl; |
53 | ExternControl_t ExternControl; |
54 | DebugOut_t DebugOut; |
54 | DebugOut_t DebugOut; |
55 | UART_VersionInfo_t UART_VersionInfo; |
55 | UART_VersionInfo_t UART_VersionInfo; |
Line 56... | Line 56... | ||
56 | 56 | ||
57 | uint16_t DebugData_Timer; |
57 | uint16_t DebugData_Timer; |
Line 58... | Line 58... | ||
58 | uint16_t DebugData_Interval = 500; // in 1ms |
58 | uint16_t DebugData_Interval = 0; // in 1ms |
Line -... | Line 59... | ||
- | 59 | ||
59 | 60 | Waypoint_t FollowMe; |
|
60 | Waypoint_t FollowMe; |
61 | |
61 | 62 | // keep lables in flash to save 512 bytes of sram space |
|
62 | const uint8_t ANALOG_LABEL[32][16] = |
63 | const prog_uint8_t ANALOG_LABEL[32][16] = |
63 | { |
64 | { |
64 | //1234567890123456 |
65 | //1234567890123456 |
Line 172... | Line 173... | ||
172 | UART_VersionInfo.ProtoMajor = VERSION_SERIAL_MAJOR; |
173 | UART_VersionInfo.ProtoMajor = VERSION_SERIAL_MAJOR; |
173 | UART_VersionInfo.ProtoMinor = VERSION_SERIAL_MINOR; |
174 | UART_VersionInfo.ProtoMinor = VERSION_SERIAL_MINOR; |
Line 174... | Line 175... | ||
174 | 175 | ||
175 | // restore global interrupt flags |
176 | // restore global interrupt flags |
- | 177 | SREG = sreg; |
|
- | 178 | sei(); |
|
176 | SREG = sreg; |
179 | printf("\r\n UART0 init...ok"); |
Line 177... | Line 180... | ||
177 | } |
180 | } |
178 | 181 | ||
179 | /****************************************************************/ |
182 | /****************************************************************/ |
Line 498... | Line 501... | ||
498 | SendOutData('L', FM_ADDRESS, 3, &MenuItem, sizeof(MenuItem), &MaxMenuItem, sizeof(MaxMenuItem), DisplayBuff, sizeof(DisplayBuff)); |
501 | SendOutData('L', FM_ADDRESS, 3, &MenuItem, sizeof(MenuItem), &MaxMenuItem, sizeof(MaxMenuItem), DisplayBuff, sizeof(DisplayBuff)); |
499 | Request_Display1 = FALSE; |
502 | Request_Display1 = FALSE; |
500 | } |
503 | } |
501 | if(Request_DebugLabel != 0xFF) // Texte für die Analogdaten |
504 | if(Request_DebugLabel != 0xFF) // Texte für die Analogdaten |
502 | { |
505 | { |
- | 506 | uint8_t label[16]; // local sram buffer |
|
- | 507 | memcpy_P(label, ANALOG_LABEL[Request_DebugLabel], 16); // read lable from flash to sram buffer |
|
503 | SendOutData('A', FM_ADDRESS, 2, (uint8_t *) &Request_DebugLabel, sizeof(Request_DebugLabel), ANALOG_LABEL[Request_DebugLabel], 16); |
508 | SendOutData('A', FM_ADDRESS, 2, (uint8_t *) &Request_DebugLabel, sizeof(Request_DebugLabel), label, 16); |
504 | Request_DebugLabel = 0xFF; |
509 | Request_DebugLabel = 0xFF; |
505 | } |
510 | } |
506 | if(Request_ExternalControl && txd_complete) |
511 | if(Request_ExternalControl && txd_complete) |
507 | { |
512 | { |
508 | SendOutData('G', FM_ADDRESS, 1,(uint8_t *) &ExternControl, sizeof(ExternControl)); |
513 | SendOutData('G', FM_ADDRESS, 1,(uint8_t *) &ExternControl, sizeof(ExternControl)); |