New warning screens

This commit is contained in:
bsongis
2012-05-23 20:15:12 +00:00
parent 090a74369a
commit 925d661640
16 changed files with 129 additions and 53 deletions
+9 -4
View File
@@ -498,9 +498,9 @@ all: begin gccversion sizebefore build sizeafter end
# Change the build target to build a HEX file or a library.
ifeq ($(PCB), ARM)
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm allsrc.cpp elf remallsrc bin hex lss
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm asterisk.lbm allsrc.cpp elf remallsrc bin hex lss
else
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm allsrc.cpp elf remallsrc hex eep lss sym
build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm asterisk.lbm allsrc.cpp elf remallsrc hex eep lss sym
endif
elf: $(TARGET).elf
@@ -541,7 +541,7 @@ arm-stamp:
@echo "#define VERS_STR \"$(MAJ_VER).$(MIN_VER)\"" >> stamp-open9x-arm.txt
@echo "#define SVN_VERS \"open9x-r$(SVNREV)\"" >> stamp-open9x-arm.txt
@cat stamp-open9x-arm.txt
font.lbm: font_6x1.xbm
@echo
@echo "Convert font from xbm to lbm:"
@@ -568,9 +568,14 @@ sticks.lbm: sticks_4x1.xbm
s9xsplash.lbm: s9xsplash.xbm
@echo
@echo "Convert font from xbm to lbm:"
@echo "Convert splash from xbm to lbm:"
$(IMG2LBM) $< $@ img
asterisk.lbm: asterisk.xbm
@echo
@echo "Convert asterisk from xbm to lbm:"
$(IMG2LBM) $< $@ img
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
+5
View File
@@ -0,0 +1,5 @@
27,32,
0xf0,0xfc,0xfc,0xfe,0xfe,0x7c,0x7c,0x78,0x78,0x70,0x70,0xe0,0xe0,0xc0,0xc0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xff,0xff,0xff,0xff,0xfe,0xfc,0xf0,0xc0,0x00,0x00,0x80,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfc,0xf8,0xf8,0xf0,0xf0,0xe0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xe1,0xe1,0xe1,0xe1,0xf3,0xff,0x7f,0x3f,0x3f,0x1f,0x0f,0x0f,0x07,0x03,0x03,0x01,0x00,
0x07,0x1f,0x3f,0x3f,0x3f,0x3f,0x1f,0x1f,0x0f,0x07,0x07,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+14
View File
@@ -0,0 +1,14 @@
#define asterisk_width 27
#define asterisk_height 32
static unsigned char asterisk_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0xfe, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00,
0xff, 0x7f, 0x00, 0x00, 0x1f, 0xf8, 0x01, 0x00, 0x0f, 0xf8, 0x07, 0x00,
0x1f, 0xf8, 0x1f, 0x00, 0x3f, 0xf8, 0x3f, 0x00, 0x3f, 0xf0, 0xff, 0x00,
0x7f, 0xf0, 0xff, 0x03, 0x7f, 0xf0, 0xff, 0x07, 0xff, 0xf0, 0xff, 0x07,
0xff, 0xfc, 0xff, 0x07, 0xff, 0xff, 0xff, 0x03, 0xff, 0xc3, 0xff, 0x01,
0xff, 0x81, 0x7f, 0x00, 0xff, 0x81, 0x3f, 0x00, 0xff, 0xc3, 0x0f, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00,
0xff, 0x3f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xfe, 0x01, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+3 -3
View File
@@ -476,7 +476,7 @@ void RlcFile::nextWriteStep()
}
if (s_write_err == ERR_FULL) {
alert(STR_EEPROMOVERFLOW);
alert(STR_EEPROMWARN, STR_EEPROMOVERFLOW);
m_write_step = 0;
m_write_len = 0;
}
@@ -884,8 +884,8 @@ void eeReadAll()
{
generalDefault();
alert(STR_BADEEPROMDATA);
message(STR_MESSAGE, STR_EEPROMFORMATTING, NULL, NULL);
alert(STR_EEPROMWARN, STR_BADEEPROMDATA);
message(STR_EEPROMWARN, STR_EEPROMFORMATTING, NULL);
EeFsFormat();
+2 -2
View File
@@ -466,7 +466,7 @@ void popMenu()
(*g_menuStack[g_menuStackPtr])(EVT_ENTRY_UP);
}
else {
alert(STR_MENUSERROR);
assert(!"Menus overflow!");
}
}
@@ -492,7 +492,7 @@ void pushMenu(MenuFuncP newMenu)
if(g_menuStackPtr >= DIM(g_menuStack))
{
g_menuStackPtr--;
alert(STR_MENUSERROR);
assert(!"Menus overflow!");
return;
}
AUDIO_MENUS();
+1 -1
View File
@@ -1546,7 +1546,7 @@ void menuProcMixOne(uint8_t event)
break;
#endif
case MIX_FIELD_WARNING:
lcd_puts( 2*FW,y,STR_WARNING);
lcd_puts( 2*FW,y,STR_MIXWARNING);
if(md2->mixWarn)
lcd_outdezAtt(FW*10,y,md2->mixWarn,attr|LEFT);
else
+7 -2
View File
@@ -137,7 +137,7 @@ const pm_char STR_OFFSET[] PROGMEM = TR_OFFSET;
const pm_char STR_TRIM[] PROGMEM = TR_TRIM;
const pm_char STR_CURVES[] PROGMEM = TR_CURVES;
const pm_char STR_FPHASE[] PROGMEM = TR_FPHASE;
const pm_char STR_WARNING[] PROGMEM = TR_WARNING;
const pm_char STR_MIXWARNING[] PROGMEM = TR_MIXWARNING;
const pm_char STR_OFF[] PROGMEM = TR_OFF;
const pm_char STR_MULTPX[] PROGMEM = TR_MULTPX;
const pm_char STR_DELAYDOWN[] PROGMEM = TR_DELAYDOWN;
@@ -231,7 +231,6 @@ const pm_char STR_PRESSANYKEY[] PROGMEM = TR_PRESSANYKEY;
const pm_char STR_BADEEPROMDATA[] PROGMEM = TR_BADEEPROMDATA;
const pm_char STR_EEPROMFORMATTING[] PROGMEM = TR_EEPROMFORMATTING;
const pm_char STR_EEPROMOVERFLOW[] PROGMEM = TR_EEPROMOVERFLOW;
const pm_char STR_MENUSERROR[] PROGMEM = TR_MENUSERROR;
const pm_char STR_TRIMS2OFFSETS[] PROGMEM = TR_TRIMS2OFFSETS;
const pm_char STR_MENURADIOSETUP[] PROGMEM = TR_MENURADIOSETUP;
@@ -323,6 +322,12 @@ const pm_char STR_MODELS_PATH[] PROGMEM = MODELS_PATH;
const pm_char STR_MODELS_EXT[] PROGMEM = MODELS_EXT;
#endif
const pm_char STR_WARNING[] PROGMEM = TR_WARNING;
const pm_char STR_EEPROMWARN[] PROGMEM = TR_EEPROMWARN;
const pm_char STR_THROTTLEWARN[] PROGMEM = TR_THROTTLEWARN;
const pm_char STR_ALARMSWARN[] PROGMEM = TR_ALARMSWARN;
const pm_char STR_SWITCHWARN[] PROGMEM = TR_SWITCHWARN;
const pm_uchar font[] PROGMEM = {
#include "font.lbm"
#if defined(TRANSLATIONS_SE)
+6 -2
View File
@@ -237,7 +237,7 @@ extern const pm_char STR_OFFSET[];
extern const pm_char STR_TRIM[];
extern const pm_char STR_CURVES[];
extern const pm_char STR_FPHASE[];
extern const pm_char STR_WARNING[];
extern const pm_char STR_MIXWARNING[];
extern const pm_char STR_OFF[];
extern const pm_char STR_MULTPX[];
extern const pm_char STR_DELAYDOWN[];
@@ -324,7 +324,6 @@ extern const pm_char STR_PRESSANYKEY[];
extern const pm_char STR_BADEEPROMDATA[];
extern const pm_char STR_EEPROMFORMATTING[];
extern const pm_char STR_EEPROMOVERFLOW[];
extern const pm_char STR_MENUSERROR[];
extern const pm_char STR_TRIMS2OFFSETS[];
extern const pm_char STR_MENURADIOSETUP[];
extern const pm_char STR_MENUDATEANDTIME[];
@@ -403,3 +402,8 @@ extern const pm_char STR_MODELS_EXT[];
extern const pm_uchar font[];
extern const pm_uchar font_dblsize[];
extern const pm_char STR_WARNING[];
extern const pm_char STR_EEPROMWARN[];
extern const pm_char STR_THROTTLEWARN[];
extern const pm_char STR_ALARMSWARN[];
extern const pm_char STR_SWITCHWARN[];
+43 -24
View File
@@ -33,11 +33,17 @@
#include "open9x.h"
#ifdef SPLASH
#if defined(SPLASH)
const pm_uchar splashdata[] PROGMEM = { 'S','P','S',0,
#include "s9xsplash.lbm"
'S','P','E',0};
const pm_uchar * s9xsplash = splashdata+4;
const pm_uchar * splash_lbm = splashdata+4;
#endif
#if defined(PCBV4) || defined(PCBARM)
const pm_uchar asterisk_lbm[] PROGMEM = {
#include "asterisk.lbm"
};
#endif
#include "menus.h"
@@ -792,7 +798,7 @@ void doSplash()
{
checkBacklight() ;
lcd_clear();
lcd_img(0, 0, s9xsplash,0,0);
lcd_img(0, 0, splash_lbm, 0, 0);
refreshDisplay();
lcdSetRefVolt(g_eeGeneral.contrast);
clearKeyEvents();
@@ -831,7 +837,7 @@ void checkLowEEPROM()
if(g_eeGeneral.disableMemoryWarning) return;
if(EeFsGetFree() < 200)
{
alert(STR_EEPROMLOWMEM);
alert(STR_EEPROMWARN, STR_EEPROMLOWMEM);
}
}
#endif
@@ -854,9 +860,8 @@ void checkTHR()
if(v<=lowLim) return;
// first - display warning
message(STR_ALERT, STR_THROTTLENOTIDLE, STR_RESETTHROTTLE, STR_PRESSANYKEYTOSKIP);
message(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP);
//loop until all switches are reset
while (1)
{
#ifdef SIMU
@@ -882,28 +887,36 @@ void checkTHR()
void checkAlarm() // added by Gohst
{
if (g_eeGeneral.disableAlarmWarning) return;
if (g_eeGeneral.beeperMode == e_mode_quiet) alert(STR_ALARMSDISABLED);
if (g_eeGeneral.beeperMode == e_mode_quiet) alert(STR_ALARMSWARN, STR_ALARMSDISABLED);
}
void checkSwitches()
{
int8_t last_bad_switch = 0;
uint8_t last_bad_switches = 0xff;
uint8_t states = g_model.switchWarningStates;
while (1) {
uint8_t states = g_model.switchWarningStates;
switches_states = (states >> 1);
int8_t bad_switch = getMovedSwitch();
getMovedSwitch();
if (states & 0x01 || states == (switches_states << 1))
switches_states <<= 1;
if ((states & 0x01) || (states == switches_states)) {
return;
}
// first - display warning
if (bad_switch != last_bad_switch) {
message(STR_ALERT, STR_SWITCHESNOTOFF, STR_PLEASERESETTHEM, STR_PRESSANYKEYTOSKIP);
putsSwitches(POS_SWITCH_WARN*FW, 4*FH, bad_switch);
if (last_bad_switches != switches_states) {
message(STR_SWITCHWARN, NULL, STR_PRESSANYKEYTOSKIP);
uint8_t x = 2;
for (uint8_t i=1; i<8; i++) {
uint8_t attr = (states & (1 << i)) == (switches_states & (1 << i)) ? 0 : INVERS;
putsSwitches(x, 5*FH, (i>5?(i+1):(i>=4?(4+((states>>4)&0x3)):i)), attr);
if (i == 4 && attr) i++;
if (i != 4) x += 3*FW+FW/2;
}
refreshDisplay();
last_bad_switch = bad_switch;
last_bad_switches = switches_states;
}
if (keyDown() || check_soft_power() > e_power_trainer) return; // Usb on or power off
@@ -917,9 +930,9 @@ void checkSwitches()
}
}
void alert(const pm_char * s)
void alert(const pm_char * t, const pm_char *s)
{
message(STR_ALERT, s, 0, STR_PRESSANYKEY);
message(t, s, STR_PRESSANYKEY);
while(1)
{
@@ -939,13 +952,19 @@ void alert(const pm_char * s)
}
}
void message(const pm_char *title, const pm_char *s, const pm_char *t, const char *last)
void message(const pm_char *title, const pm_char *t, const char *last)
{
lcd_clear();
lcd_putsAtt(0, 0, title, DBLSIZE);
lcd_putsLeft(4*FH, s);
if (t)
lcd_putsLeft(5*FH, t);
#if defined(PCBV4) || defined(PCBARM)
lcd_img(1, 0, asterisk_lbm, 0, 0);
#else
lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE);
#endif
lcd_putsAtt(6*FW, 0, title, DBLSIZE);
lcd_putsAtt(6*FW, 2*FH, STR_WARNING, DBLSIZE);
lcd_filled_rect(0, 0, 128, 32);
if (t) lcd_putsLeft(5*FH, t);
if (last) {
lcd_putsLeft(7*FH, last);
AUDIO_ERROR();
+2 -2
View File
@@ -504,8 +504,8 @@ void readKeysAndTrims();
uint16_t evalChkSum();
extern void alert(const pm_char * s);
extern void message(const pm_char *title, const pm_char *s, const pm_char *t, const char *last);
extern void alert(const pm_char * t, const pm_char * s);
extern void message(const pm_char *title, const pm_char *s, const char *last);
void perMain();
void per10ms();
+6 -2
View File
@@ -262,7 +262,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "K\206ivka"
#define TR_FPHASE "F\200ze"
#define TR_WARNING "Varov\200n\204"
#define TR_MIXWARNING "Varov\200n\204"
#define TR_OFF "VYP"
#define TR_MULTPX "Multpx"
#define TR_DELAYDOWN "Zpo\217d\203n\204 Vyp"
@@ -359,7 +359,6 @@
#define TR_MENUDIAG "DIAG"
#define TR_MENUANA "ANALOGY"
#define TR_MENUCALIBRATION "KALIBRACE"
#define TR_MENUSERROR "MENUS OVERFLOW"
#define TR_TRIMS2OFFSETS "Trimy => Offsety"
#define TR_MENUMODELSEL "MODEL"
#define TR_MENUSETUP "NASTAVEN\214"
@@ -398,3 +397,8 @@
#define TR_RESTORE_MODEL "Restore Model"
#define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"
+7 -3
View File
@@ -257,7 +257,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "Kurven"
#define TR_FPHASE "F.Phase"
#define TR_WARNING "Warnung"
#define TR_MIXWARNING "Warnung"
#define TR_OFF "OFF"
#define TR_MULTPX "Multpx"
#define TR_DELAYDOWN "Verz. Unten"
@@ -353,8 +353,7 @@
#define TR_MENUVERSION "VERSION"
#define TR_MENUDIAG "DIAG"
#define TR_MENUANA "ANALOG INPUTS"
#define TR_MENUCALIBRATION "KALIBRIERUNG"
#define TR_MENUSERROR "MENUS OVERFLOW"
#define TR_MENUCALIBRATION "KALIBRIERUNG"
#define TR_TRIMS2OFFSETS "Trims => Offsets"
#define TR_MENUMODELSEL "MODELLE"
#define TR_MENUSETUP "SETUP"
@@ -393,3 +392,8 @@
#define TR_RESTORE_MODEL "Modell Restore"
#define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "Keine SDCARD"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"
+6 -2
View File
@@ -262,7 +262,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "Curves"
#define TR_FPHASE "F.Phase"
#define TR_WARNING "Warning"
#define TR_MIXWARNING "Warning"
#define TR_OFF "OFF"
#define TR_MULTPX "Multpx"
#define TR_DELAYDOWN "Delay Down"
@@ -359,7 +359,6 @@
#define TR_MENUDIAG "DIAG"
#define TR_MENUANA "ANAS"
#define TR_MENUCALIBRATION "CALIBRATION"
#define TR_MENUSERROR "MENUS OVERFLOW"
#define TR_TRIMS2OFFSETS "Trims => Offsets"
#define TR_MENUMODELSEL "MODELSEL"
#define TR_MENUSETUP "SETUP"
@@ -398,3 +397,8 @@
#define TR_RESTORE_MODEL "Restore Model"
#define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"
+6 -2
View File
@@ -260,7 +260,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "Courbe"
#define TR_FPHASE "P.Vol"
#define TR_WARNING "Alerte"
#define TR_MIXWARNING "Alerte"
#define TR_OFF "OFF"
#define TR_MULTPX "Multpx"
#define TR_DELAYDOWN "Retard Bas"
@@ -357,7 +357,6 @@
#define TR_MENUDIAG "DIAG"
#define TR_MENUANA "ANAS"
#define TR_MENUCALIBRATION "CALIBRATION"
#define TR_MENUSERROR "MENUS OVERFLOW"
#define TR_TRIMS2OFFSETS "Trims => Offsets"
#define TR_MENUMODELSEL "MODELES"
#define TR_MENUSETUP "SETUP"
@@ -397,3 +396,8 @@
#define TR_RESTORE_MODEL "R\200storer Mod\201le"
#define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"
+6 -2
View File
@@ -257,7 +257,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "Curva"
#define TR_FPHASE "Fase V."
#define TR_WARNING "Avviso"
#define TR_MIXWARNING "Avviso"
#define TR_OFF "OFF"
#define TR_MULTPX "MultPx"
#define TR_DELAYDOWN "Post. Gi\200 "
@@ -354,7 +354,6 @@
#define TR_MENUDIAG "DIAG"
#define TR_MENUANA "ANAS"
#define TR_MENUCALIBRATION "CALIBRAZIONE"
#define TR_MENUSERROR "Errore Men\200 "
#define TR_TRIMS2OFFSETS "Trim => Offset "
#define TR_MENUMODELSEL "MODELLI"
#define TR_MENUSETUP "SETUP"
@@ -393,3 +392,8 @@
#define TR_RESTORE_MODEL "Ripr. Modello"
#define TR_SDCARD_ERROR "Errore SD"
#define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"
+6 -2
View File
@@ -260,7 +260,7 @@
#define TR_TRIM "Trim"
#define TR_CURVES "Kurvor"
#define TR_FPHASE "Flygfas"
#define TR_WARNING "Varning"
#define TR_MIXWARNING "Varning"
#define TR_OFF "AV "
#define TR_MULTPX "Multpx"
#define TR_DELAYDOWN "F\202rdr\202jn.Ned"
@@ -357,7 +357,6 @@
#define TR_MENUDIAG "DIAGNOS"
#define TR_MENUANA "ANALOGA V\204RDEN"
#define TR_MENUCALIBRATION "KALIBRERING"
#define TR_MENUSERROR "FEL I MENU"
#define TR_TRIMS2OFFSETS "[Spara Trimv\201rden]"
#define TR_MENUMODELSEL "MODELL"
#define TR_MENUSETUP "KONF."
@@ -397,3 +396,8 @@
#define TR_RESTORE_MODEL "\203terst\201ll Modell"
#define TR_SDCARD_ERROR "SDCARD-fel"
#define TR_NO_SDCARD "SDCARD saknas"
#define TR_WARNING "WARNING"
#define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE"
#define TR_ALARMSWARN "ALARMS"
#define TR_SWITCHWARN "SWITCH"