Rev 328 | Rev 330 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 328 | Rev 329 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | 36 | ||
37 | /* ########################################################################## |
37 | /* ########################################################################## |
38 | * Debugging and general purpose definitions |
38 | * Debugging and general purpose definitions |
39 | * ##########################################################################*/ |
39 | * ##########################################################################*/ |
- | 40 | #define ALLCHARSDEBUG 0 // set to 1 and flash firmware to see all chars |
|
- | 41 | ||
40 | #define ALLCHARSDEBUG 0 // set to 1 and flash firmware to see all chars |
42 | #ifndef WRITECHARS // if WRITECHARS not set via makefile |
41 | #define WRITECHARS 0 // set to 2XX and flash firmware to write new char |
43 | #define WRITECHARS -1 // set to 2XX and flash firmware to write new char |
- | 44 | // enables the allchars as well to see results |
|
- | 45 | #endif |
|
- | 46 | ||
42 | // enables the allchars as well to see results |
47 | #ifndef NTSC // if NTSC is not thet via makefile |
- | 48 | #define NTSC 0 // set to 1 for NTSC mode + lifts the bottom line |
|
- | 49 | #endif |
|
43 | #define NTSC 0 // set to 1 for NTSC mode + lifts the bottom line |
50 | |
44 | #define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon |
51 | #define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon |
45 | #define NOOSD 0 // set to 1 to disable OSD completely |
52 | #define NOOSD 0 // set to 1 to disable OSD completely |
46 | #define NOOSD_BUT_WRN 0 // set to 1 to disable OSD completely but show |
53 | #define NOOSD_BUT_WRN 0 // set to 1 to disable OSD completely but show |
47 | // battery and receive signal warnings |
54 | // battery and receive signal warnings |
Line 98... | Line 105... | ||
98 | #define u16 uint16_t |
105 | #define u16 uint16_t |
99 | #define s16 int16_t |
106 | #define s16 int16_t |
100 | #define u32 uint32_t |
107 | #define u32 uint32_t |
101 | #define s32 int32_t |
108 | #define s32 int32_t |
Line 102... | Line 109... | ||
102 | 109 | ||
103 | #if !(ALLCHARSDEBUG|WRITECHARS) |
110 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
104 | /* ########################################################################## |
111 | /* ########################################################################## |
105 | * MK data strucs & flags |
112 | * MK data strucs & flags |
106 | * ##########################################################################*/ |
113 | * ##########################################################################*/ |
107 | #define NC_FLAG_FREE 1 |
114 | #define NC_FLAG_FREE 1 |
Line 196... | Line 203... | ||
196 | 203 | ||
197 | // 16bit should be enough, normal LiPos don't last that long |
204 | // 16bit should be enough, normal LiPos don't last that long |
198 | volatile uint16_t uptime = 0; |
205 | volatile uint16_t uptime = 0; |
Line 199... | Line 206... | ||
199 | volatile uint16_t timer = 0; |
206 | volatile uint16_t timer = 0; |
Line 200... | Line 207... | ||
200 | 207 | ||
201 | #endif // ends !(ALLCHARSDEBUG|WRITECHARS) |
208 | #endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
202 | 209 | ||
Line 485... | Line 492... | ||
485 | x = 3; |
492 | x = 3; |
486 | } |
493 | } |
487 | } |
494 | } |
488 | } |
495 | } |
Line 489... | Line 496... | ||
489 | 496 | ||
490 | #if !(ALLCHARSDEBUG|WRITECHARS) |
497 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
491 | /* ########################################################################## |
498 | /* ########################################################################## |
492 | * USART stuff |
499 | * USART stuff |
Line 493... | Line 500... | ||
493 | * ##########################################################################*/ |
500 | * ##########################################################################*/ |
Line 855... | Line 862... | ||
855 | 862 | ||
856 | // enable interrupts again |
863 | // enable interrupts again |
857 | sei(); |
864 | sei(); |
Line 858... | Line 865... | ||
858 | } |
865 | } |
Line 859... | Line 866... | ||
859 | 866 | ||
860 | #endif // ends !(ALLCHARSDEBUG|WRITECHARS) |
867 | #endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
861 | 868 | ||
862 | /* ########################################################################## |
869 | /* ########################################################################## |
Line 917... | Line 924... | ||
917 | LED4_OFF |
924 | LED4_OFF |
Line 918... | Line 925... | ||
918 | 925 | ||
919 | /* ########################################################################## |
926 | /* ########################################################################## |
920 | * Pushing NEW chars to the MAX7456 |
927 | * Pushing NEW chars to the MAX7456 |
921 | * ##########################################################################*/ |
928 | * ##########################################################################*/ |
922 | #if WRITECHARS |
929 | #if (WRITECHARS != -1) |
923 | void learn_char(uint8_t number, unsigned char* data) { |
930 | void learn_char(uint8_t number, unsigned char* data) { |
924 | // select character to write (CMAH) |
931 | // select character to write (CMAH) |
Line 925... | Line 932... | ||
925 | spi_send_byte(0x09, number); |
932 | spi_send_byte(0x09, number); |
Line 1300... | Line 1307... | ||
1300 | spi_send_byte(0x04, 0b01000000); |
1307 | spi_send_byte(0x04, 0b01000000); |
Line 1301... | Line 1308... | ||
1301 | 1308 | ||
1302 | // write blank chars to whole screen |
1309 | // write blank chars to whole screen |
Line 1303... | Line 1310... | ||
1303 | clear(); |
1310 | clear(); |
1304 | 1311 | ||
1305 | #if !(ALLCHARSDEBUG|WRITECHARS) |
1312 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
Line 1306... | Line 1313... | ||
1306 | // init usart |
1313 | // init usart |
1307 | usart1_init(); |
1314 | usart1_init(); |
Line 1340... | Line 1347... | ||
1340 | // we are ready |
1347 | // we are ready |
1341 | LED3_ON |
1348 | LED3_ON |
Line 1342... | Line 1349... | ||
1342 | 1349 | ||
1343 | 1350 | ||
1344 | 1351 | ||
1345 | #if ALLCHARSDEBUG | WRITECHARS |
1352 | #if ALLCHARSDEBUG | (WRITECHARS != -1) |
1346 | clear(); |
1353 | clear(); |
1347 | write_all_chars(); |
1354 | write_all_chars(); |