[Taranis] Splash on SD. Various fixes.
This commit is contained in:
+17
-5
@@ -1568,7 +1568,9 @@ void doSplash()
|
|||||||
|
|
||||||
#if defined(PCBSTD)
|
#if defined(PCBSTD)
|
||||||
lcdSetContrast();
|
lcdSetContrast();
|
||||||
#elif !defined(PCBTARANIS)
|
#elif defined(PCBTARANIS)
|
||||||
|
bool secondSplash = false;
|
||||||
|
#else
|
||||||
tmr10ms_t curTime = get_tmr10ms() + 10;
|
tmr10ms_t curTime = get_tmr10ms() + 10;
|
||||||
uint8_t contrast = 10;
|
uint8_t contrast = 10;
|
||||||
lcdSetRefVolt(contrast);
|
lcdSetRefVolt(contrast);
|
||||||
@@ -1579,8 +1581,7 @@ void doSplash()
|
|||||||
uint16_t inacSum = stickMoveValue();
|
uint16_t inacSum = stickMoveValue();
|
||||||
|
|
||||||
tmr10ms_t tgtime = get_tmr10ms() + SPLASH_TIMEOUT;
|
tmr10ms_t tgtime = get_tmr10ms() + SPLASH_TIMEOUT;
|
||||||
while (tgtime != get_tmr10ms())
|
while (tgtime != get_tmr10ms()) {
|
||||||
{
|
|
||||||
#if defined(SIMU)
|
#if defined(SIMU)
|
||||||
SIMU_SLEEP(1);
|
SIMU_SLEEP(1);
|
||||||
#elif defined(CPUARM)
|
#elif defined(CPUARM)
|
||||||
@@ -1598,7 +1599,17 @@ void doSplash()
|
|||||||
|
|
||||||
if (pwrCheck()==e_power_off) return;
|
if (pwrCheck()==e_power_off) return;
|
||||||
|
|
||||||
#if !defined(PCBSTD) && !defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
|
if (!secondSplash && get_tmr10ms() >= tgtime-SPLASH_TIMEOUT/2) {
|
||||||
|
secondSplash = true;
|
||||||
|
static uint8_t sdSplash[2+4*(LCD_W*LCD_H/8)];
|
||||||
|
if (!bmpLoad(sdSplash, BITMAPS_PATH "/splash.bmp", LCD_W, LCD_H)) {
|
||||||
|
lcd_clear();
|
||||||
|
lcd_bmp(0, 0, sdSplash);
|
||||||
|
lcdRefresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif !defined(PCBSTD)
|
||||||
if (curTime < get_tmr10ms()) {
|
if (curTime < get_tmr10ms()) {
|
||||||
curTime += 10;
|
curTime += 10;
|
||||||
if (contrast < g_eeGeneral.contrast) {
|
if (contrast < g_eeGeneral.contrast) {
|
||||||
@@ -1613,6 +1624,7 @@ void doSplash()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#define Splash()
|
||||||
#define doSplash()
|
#define doSplash()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2413,7 +2425,7 @@ uint8_t fnSwitchDuration[NUM_CFN] = { 0 };
|
|||||||
|
|
||||||
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
||||||
{
|
{
|
||||||
char filename[] = SOUNDS_PATH "/xxxxxx.wav";
|
char filename[sizeof(SOUNDS_PATH)+sizeof(sd->param.name)+sizeof(SOUNDS_EXT)] = SOUNDS_PATH "/";
|
||||||
strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2);
|
strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2);
|
||||||
strncpy(filename+sizeof(SOUNDS_PATH), sd->param.name, sizeof(sd->param.name));
|
strncpy(filename+sizeof(SOUNDS_PATH), sd->param.name, sizeof(sd->param.name));
|
||||||
filename[sizeof(SOUNDS_PATH)+sizeof(sd->param.name)] = '\0';
|
filename[sizeof(SOUNDS_PATH)+sizeof(sd->param.name)] = '\0';
|
||||||
|
|||||||
+2
-2
@@ -542,7 +542,7 @@ FRESULT f_unlink (const TCHAR*)
|
|||||||
|
|
||||||
int f_putc (TCHAR c, FIL * fil)
|
int f_putc (TCHAR c, FIL * fil)
|
||||||
{
|
{
|
||||||
if (fil->fs) fwrite(&c, 1, 1, (FILE*)fil->fs);
|
if (fil && fil->fs) fwrite(&c, 1, 1, (FILE*)fil->fs);
|
||||||
return FR_OK;
|
return FR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,7 +559,7 @@ int f_printf (FIL *fil, const TCHAR * format, ...)
|
|||||||
{
|
{
|
||||||
va_list arglist;
|
va_list arglist;
|
||||||
va_start(arglist, format);
|
va_start(arglist, format);
|
||||||
if (fil->fs) vfprintf((FILE*)fil->fs, format, arglist);
|
if (fil && fil->fs) vfprintf((FILE*)fil->fs, format, arglist);
|
||||||
va_end(arglist);
|
va_end(arglist);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user