Rev 507 | Rev 519 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 507 | Rev 514 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | #include "config.h" |
27 | #include "config.h" |
28 | #include "main.h" |
28 | #include "main.h" |
29 | #include "buttons.h" |
29 | #include "buttons.h" |
30 | #include "usart1.h" |
30 | #include "usart1.h" |
Line 31... | Line -... | ||
31 | - | ||
32 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
- | |
33 | - | ||
34 | // store more fixed strings in progmen |
- | |
35 | char ON[] PROGMEM = "ON "; |
- | |
36 | char OFF[] PROGMEM = "OFF"; |
- | |
37 | 31 | ||
38 | uint8_t EEMEM ee_checkbyte1 = CHECKBYTE1; |
32 | uint8_t EEMEM ee_checkbyte1 = CHECKBYTE1; |
39 | uint8_t EEMEM ee_checkbyte2 = CHECKBYTE2; |
33 | uint8_t EEMEM ee_checkbyte2 = CHECKBYTE2; |
40 | uint16_t EEMEM ee_cal_ampere = 512; |
34 | uint16_t EEMEM ee_cal_ampere = 512; |
41 | uint8_t EEMEM ee_sensor = 50; |
35 | uint8_t EEMEM ee_sensor = 50; |
42 | uint8_t EEMEM ee_COSD_FLAGS; |
36 | uint8_t EEMEM ee_COSD_FLAGS; |
Line -... | Line 37... | ||
- | 37 | uint8_t EEMEM ee_COSD_DISPLAYMODE = 0; |
|
- | 38 | ||
- | 39 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
|
- | 40 | ||
- | 41 | // store more fixed strings in progmen |
|
- | 42 | char ON[] PROGMEM = "ON "; |
|
43 | uint8_t EEMEM ee_COSD_DISPLAYMODE = 0; |
43 | char OFF[] PROGMEM = "OFF"; |
44 | 44 | ||
45 | // store init strings in progmem |
45 | // store init strings in progmem |
46 | const char init_0[] PROGMEM = "C-OSD Initialisation"; |
46 | const char init_0[] PROGMEM = "C-OSD Initialisation"; |
47 | const char init_1[] PROGMEM = "FC only Mode"; |
47 | const char init_1[] PROGMEM = "FC only Mode"; |
48 | const char init_2[] PROGMEM = "NaviCtrl Mode"; |
48 | const char init_2[] PROGMEM = "NaviCtrl Mode"; |
49 | const char init_3[] PROGMEM = "Guessing Number of Cells"; |
49 | const char init_3[] PROGMEM = "Guessing Number of Cells"; |
50 | const char init_4[] PROGMEM = "Number of Cells:"; |
50 | const char init_4[] PROGMEM = "Number of Cells:"; |
51 | const char init_5[] PROGMEM = "Warn Voltage :"; |
51 | const char init_5[] PROGMEM = "Warn Voltage :"; |
Line 52... | Line -... | ||
52 | const char init_6[] PROGMEM = "Max Voltage :"; |
- | |
53 | const char* init_point[] PROGMEM = {init_0, init_1, init_2, init_3, init_4, init_5, init_6}; |
- | |
54 | - | ||
55 | const char ee_message0[] PROGMEM = "Loading Data from EEPROM"; |
- | |
56 | const char ee_message1[] PROGMEM = "No saved Data in EEPROM"; |
52 | const char init_6[] PROGMEM = "Max Voltage :"; |
57 | const char* ee_msg[] PROGMEM = {ee_message0, ee_message1}; |
53 | const char* init_point[] PROGMEM = {init_0, init_1, init_2, init_3, init_4, init_5, init_6}; |
58 | 54 | ||
Line 59... | Line 55... | ||
59 | // video modes |
55 | // video modes |
Line 75... | Line 71... | ||
75 | const char* menu[] = {menu_item0, menu_item1, menu_item2, menu_item3, menu_item4, |
71 | const char* menu[] = {menu_item0, menu_item1, menu_item2, menu_item3, menu_item4, |
76 | menu_item5, menu_item6, menu_item7, menu_item8, menu_item9, menu_item10}; |
72 | menu_item5, menu_item6, menu_item7, menu_item8, menu_item9, menu_item10}; |
Line 77... | Line 73... | ||
77 | 73 | ||
Line -... | Line 74... | ||
- | 74 | const displaymode_t * mode; |
|
- | 75 | ||
- | 76 | #endif |
|
- | 77 | ||
- | 78 | const char ee_message0[] PROGMEM = "Loading Data from EEPROM"; |
|
- | 79 | const char ee_message1[] PROGMEM = "No saved Data in EEPROM"; |
|
78 | const displaymode_t * mode; |
80 | const char* ee_msg[] PROGMEM = {ee_message0, ee_message1}; |
79 | 81 | ||
80 | /** |
82 | /** |
81 | * read data saved in eeprom, print out message if <verbose> is set |
83 | * read data saved in eeprom, print out message if <verbose> is set |
82 | */ |
84 | */ |
- | 85 | void get_eeprom(uint8_t verbose) { |
|
83 | void get_eeprom(uint8_t verbose) { |
86 | if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) { |
- | 87 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
|
84 | if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) { |
88 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[0]); // Loading data |
85 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[0]); // Loading data |
89 | #endif |
86 | COSD_FLAGS = eeprom_read_byte(&ee_COSD_FLAGS); |
90 | COSD_FLAGS = eeprom_read_byte(&ee_COSD_FLAGS); |
87 | COSD_DISPLAYMODE = eeprom_read_byte(&ee_COSD_DISPLAYMODE); |
91 | COSD_DISPLAYMODE = eeprom_read_byte(&ee_COSD_DISPLAYMODE); |
- | 92 | //if (verbose) write_ndigit_number_u(23, 11, COSD_DISPLAYMODE, 10, 0); |
|
88 | //if (verbose) write_ndigit_number_u(23, 11, COSD_DISPLAYMODE, 10, 0); |
93 | } else { |
- | 94 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
|
89 | } else { |
95 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[1]); // Loading data |
90 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[1]); // No data found |
96 | #endif |
Line -... | Line 97... | ||
- | 97 | } |
|
- | 98 | } |
|
91 | } |
99 | |
92 | } |
100 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
93 | 101 | ||
94 | /** |
102 | /** |
95 | * save data to eeprom |
103 | * save data to eeprom |