41,16 → 41,6 |
char ON[] PROGMEM = "ON "; |
char OFF[] PROGMEM = "OFF"; |
|
// store init strings in progmem |
const char init_0[] PROGMEM = "C-OSD Initialisation"; |
const char init_1[] PROGMEM = "FC only Mode"; |
const char init_2[] PROGMEM = "NaviCtrl Mode"; |
const char init_3[] PROGMEM = "Guessing Number of Cells"; |
const char init_4[] PROGMEM = "Number of Cells:"; |
const char init_5[] PROGMEM = "Warn Voltage :"; |
const char init_6[] PROGMEM = "Max Voltage :"; |
const char* init_point[] PROGMEM = {init_0, init_1, init_2, init_3, init_4, init_5, init_6}; |
|
// video modes |
const char VM_PAL[] PROGMEM = "PAL "; |
const char VM_NTSC[] PROGMEM = "NTSC"; |
118,20 → 108,16 |
*/ |
void init_cosd(uint8_t UBat) { |
clear(); |
write_ascii_string_pgm(2, 1, init_point[0]); // C-OSD Initialisation |
//write_ascii_string(2, 1, "C-OSD Initialisation"); |
write_ascii_string_pgm(2, 1, PSTR("C-OSD Initialisation")); // C-OSD Initialisation |
#if FCONLY |
write_ascii_string_pgm(2, 2, init_point[1]); // FC only mode |
//write_ascii_string(2, 2, "FC only Mode"); |
write_ascii_string_pgm(2, 2, PSTR("FC only Mode")); // FC only mode |
#else |
write_ascii_string_pgm(2, 2, init_point[2]); // NaviCtrl Mode |
//write_ascii_string(2, 2, "NaviCtrl Mode"); |
write_ascii_string_pgm(2, 2, PSTR("NaviCtrl Mode")); // NaviCtrl Mode |
#endif |
write_ascii_string_pgm(2, 3, PSTR(BUILDDATE)); |
uint8_t cellnum = 0; |
if (CELL_NUM == -1) { |
write_ascii_string_pgm(2, 4, init_point[3]); // Guessing Number of Cells |
//write_ascii_string(2, 6, "Guessing Number of Cells"); |
write_ascii_string_pgm(2, 4, PSTR("Guessing Number of Cells")); // Guessing Number of Cells |
do { |
cellnum++; |
} while (UBat > ((cellnum * CELL_VOLT_MAX) + 23)); |
140,14 → 126,11 |
} |
min_voltage = cellnum * CELL_VOLT_MIN; |
max_voltage = cellnum * CELL_VOLT_MAX; |
write_ascii_string_pgm(2, 5, init_point[4]); // Number of Cells |
//write_ascii_string(2, 5, "Number of Cells:"); |
write_ascii_string_pgm(2, 5, PSTR("Number of Cells:")); // Number of Cells |
write_ndigit_number_u(21, 5, cellnum, 1, 0); |
write_ascii_string_pgm(2, 6, init_point[5]); // Warn Voltage |
//write_ascii_string(2, 6, "Warn Voltage :"); |
write_ascii_string_pgm(2, 6, PSTR("Warn Voltage :")); // Warn Voltage |
write_ndigit_number_s_10th(20, 6, min_voltage, 3, 0); |
write_ascii_string_pgm(2, 7, init_point[6]); // Max Voltage |
//write_ascii_string(2, 7, "Max Voltage :"); |
write_ascii_string_pgm(2, 7, PSTR("Max Voltage :")); // Max Voltage |
write_ndigit_number_s_10th(20, 7, max_voltage, 3, 0); |
|
get_eeprom(1); |
198,7 → 181,7 |
usart1_request_mk_data(1, 'o', 100); |
#endif |
|
_delay_ms(2000); |
_delay_ms(3000); |
clear(); |
// update flags to paint display again because of clear |
COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |