Option UNITS=IMPERIAL added
SD card archive function continued (doesn't delete the model until function finished) Alternate view for outputs in Main Views (Bars and Numbers) GPS speed was badly displayed (ap instead of bp)
This commit is contained in:
+10
-2
@@ -104,9 +104,13 @@ DSM2 = NO
|
||||
SOMO = NO
|
||||
|
||||
# TRANSLATIONS
|
||||
# Values = en,
|
||||
# Values = en, fr, se
|
||||
TRANSLATIONS = EN
|
||||
|
||||
# UNITS
|
||||
# Values = imperial, metric
|
||||
UNITS = METRIC
|
||||
|
||||
# EEPROM_PROGRESS_BAR
|
||||
# Values = YES, NO
|
||||
EEPROM_PROGRESS_BAR = NO
|
||||
@@ -212,6 +216,10 @@ EXTRAINCDIRS = . translations
|
||||
|
||||
CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS)
|
||||
|
||||
ifeq ($(UNITS), IMPERIAL)
|
||||
CPPDEFS += -DIMPERIAL_UNITS
|
||||
endif
|
||||
|
||||
# If POT1/POTS/RE1 is used for fields modification
|
||||
ifeq ($(NAVIGATION), POT1)
|
||||
CPPDEFS += -DNAVIGATION_POT1
|
||||
@@ -315,7 +323,7 @@ ifeq ($(PCB), V4)
|
||||
endif
|
||||
|
||||
ifeq ($(SDCARD), YES)
|
||||
CPPDEFS += -DSDCARD
|
||||
CPPDEFS += -DSDCARD
|
||||
CPPSRC += gruvin9x/logs.cpp
|
||||
MODS:=${MODS}S
|
||||
endif
|
||||
|
||||
+27
-14
@@ -531,34 +531,47 @@ const pm_char * eeArchiveModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char *buf = reusableBuffer.model_name;
|
||||
FIL archiveFile;
|
||||
UINT written;
|
||||
|
||||
FRESULT result = f_mount(0, &g_FATFS_Obj);
|
||||
if (result != FR_OK) {
|
||||
return PSTR("SDCARD F/S ERROR"); // TODO ...
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
strcpy_P(buf, PSTR(LOG_PATH "/Twister.bin")); // TODO Not PSTR everywhere ...
|
||||
/* eeLoadModelName(i_fileSrc, &buf[sizeof(LOG_PATH)+1]);
|
||||
uint8_t i = sizeof(LOG_PATH)+1;
|
||||
while (i<sizeof(LOG_PATH)+11 && buf[i]) {
|
||||
buf[i] = idx2char(buf[i]);
|
||||
i++;
|
||||
strcpy_P(buf, PSTR(MODELS_PATH "/")); // TODO Not PSTR everywhere ...
|
||||
|
||||
eeLoadModelName(i_fileSrc, &buf[sizeof(MODELS_PATH)]);
|
||||
buf[sizeof(MODELS_PATH)+sizeof(g_model.name)] = '\0';
|
||||
|
||||
uint8_t i = sizeof(MODELS_PATH)+sizeof(g_model.name)-1;
|
||||
uint8_t len = 0;
|
||||
while (i>sizeof(MODELS_PATH)-1) {
|
||||
if (!len && buf[i])
|
||||
len = i+1;
|
||||
if (len)
|
||||
buf[i] = idx2char(buf[i]);
|
||||
i--;
|
||||
}
|
||||
strcpy_P(&buf[i], PSTR(".bin")); // TODO Not PSTR everywhere ...
|
||||
*/
|
||||
strcpy_P(&buf[len], PSTR(".bin")); // TODO Not PSTR everywhere ...
|
||||
|
||||
result = f_open(&archiveFile, buf, FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
result = f_write(&archiveFile, &g_eeGeneral.myVers, 1, &written);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
EFile theFile2;
|
||||
theFile2.openRd(FILE_MODEL(i_fileSrc));
|
||||
|
||||
uint8_t len;
|
||||
while ((len=theFile2.read((uint8_t *)buf, 15)))
|
||||
{
|
||||
for (uint8_t i=0; i<len; i++)
|
||||
f_putc(buf[i], &g_oLogFile);
|
||||
while ((len=theFile2.read((uint8_t *)buf, 15))) {
|
||||
result = f_write(&archiveFile, (uint8_t *)buf, len, &written);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
}
|
||||
|
||||
f_close(&archiveFile);
|
||||
|
||||
@@ -851,6 +851,19 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value)
|
||||
|
||||
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att)
|
||||
{
|
||||
#ifdef IMPERIAL_UNITS
|
||||
if (unit == UNIT_DEGREES) {
|
||||
val += 18 ;
|
||||
val *= 115 ;
|
||||
val >>= 6 ;
|
||||
}
|
||||
if (unit == UNIT_METERS) {
|
||||
// m to ft *105/32
|
||||
val = val * 3 + ( val >> 2 ) + (val >> 5) ;
|
||||
unit = UNIT_MAX;
|
||||
}
|
||||
#endif
|
||||
|
||||
lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att & (~NO_UNIT)); // TODO we could add this test inside lcd_outdezAtt!
|
||||
if (~att & NO_UNIT && unit != UNIT_RAW)
|
||||
lcd_putsiAtt(lcd_lastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
@@ -864,6 +877,7 @@ static const pm_uint8_t bchunit_ar[] PROGMEM = {
|
||||
UNIT_DEGREES, // T2
|
||||
UNIT_KMH, // Speed
|
||||
UNIT_METERS, // Dist
|
||||
UNIT_METERS, // GPS Alt
|
||||
};
|
||||
|
||||
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att)
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class FrskyData: public FrskyRSSI {
|
||||
#if defined(FRSKY_HUB)
|
||||
PACK(struct FrskyHubData {
|
||||
int16_t baroAltitudeOffset;// spare reused
|
||||
int16_t gpsAltitude_bp; // 0x01 before punct
|
||||
int16_t gpsAltitude_bp; // 0x01 before punct
|
||||
int16_t temperature1; // 0x02 -20 .. 250 deg. celcius
|
||||
uint16_t rpm; // 0x03 0..60,000 revs. per minute
|
||||
uint16_t fuelLevel; // 0x04 0, 25, 50, 75, 100 percent
|
||||
|
||||
+12
-14
@@ -333,23 +333,21 @@ void menuProcSetup(uint8_t event)
|
||||
if (sub==subN)
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_putsLeft( y, STR_GPSCOORD);
|
||||
lcd_putsiAtt(GENERAL_PARAM_OFS, y, STR_GPSFORMAT, g_eeGeneral.gpsFormat, (sub==subN ? INVERS:0));
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.gpsFormat, 0, 1);
|
||||
g_eeGeneral.gpsFormat = selectMenuItem(y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, sub==subN, event);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
}subN++;
|
||||
#endif
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t attr = sub==subN?INVERS:0;
|
||||
lcd_putsLeft( y,STR_RXCHANNELORD);// RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++)
|
||||
putsChnLetter(GENERAL_PARAM_OFS - FW + i*FW, y, channel_order(i), attr);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
if((y+=FH)>7*FH) return;
|
||||
uint8_t attr = sub==subN?INVERS:0;
|
||||
lcd_putsLeft( y,STR_RXCHANNELORD);// RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++)
|
||||
putsChnLetter(GENERAL_PARAM_OFS - FW + i*FW, y, channel_order(i), attr);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
@@ -517,7 +515,7 @@ void menuProcTrainer(uint8_t event)
|
||||
|
||||
edit = (m_posVert==5);
|
||||
lcd_puts(0*FW, 6*FH, STR_MULTIPLIER);
|
||||
lcd_outdezAtt(13*FW, 6*FH, g_eeGeneral.PPM_Multiplier+10, (edit ? INVERS : 0)|PREC1);
|
||||
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, 6*FH, g_eeGeneral.PPM_Multiplier+10, (edit ? INVERS : 0)|PREC1);
|
||||
if (edit) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||
|
||||
edit = (m_posVert==6);
|
||||
@@ -617,12 +615,12 @@ void menuProcDiagAna(uint8_t event)
|
||||
|
||||
// Voltage calibration
|
||||
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
||||
putsVolts(17*FW, 6*FH-2, g_vbat100mV, (m_posVert==1 ? INVERS : 0));
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, g_vbat100mV, (m_posVert==1 ? INVERS : 0));
|
||||
if (m_posVert==1) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127);
|
||||
|
||||
#if defined(PCBARM) && defined(REVB)
|
||||
lcd_putsLeft(7*FH-2, STR_CURRENT_CALIB);
|
||||
putsTelemetryValue(17*FW, 7*FH-2, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ;
|
||||
putsTelemetryValue(LEN_CALIB_FIELDS*FW+4*FW, 7*FH-2, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ;
|
||||
if (m_posVert==2) CHECK_INCDEC_GENVAR(event, g_eeGeneral.currentCalib, -49, 49);
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -439,7 +439,7 @@ FRESULT f_readdir (DIR*, FILINFO*); /* Read a directory item */
|
||||
FRESULT f_stat (const TCHAR*, FILINFO*); /* Get file status */
|
||||
|
||||
#if !_FS_READONLY
|
||||
FRESULT f_write (FIL*, const void*, UINT, UINT*); /* Write data to a file */
|
||||
FRESULT f_write (FIL*, const BYTE *, UINT, UINT*); /* Write data to a file */
|
||||
FRESULT f_getfree (const TCHAR*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
|
||||
FRESULT f_truncate (FIL*); /* Truncate file */
|
||||
FRESULT f_sync (FIL*); /* Flush cached data of a writing file */
|
||||
|
||||
@@ -40,6 +40,7 @@ FIL g_oLogFile;
|
||||
int8_t g_logState = 0; // 0=closed, >0=opened, <0=error
|
||||
const pm_char * g_logError = NULL;
|
||||
|
||||
// TODO initSDCard()
|
||||
void initLogs()
|
||||
{
|
||||
// Determine and set log file filename
|
||||
@@ -65,6 +66,18 @@ void initLogs()
|
||||
return;
|
||||
}
|
||||
|
||||
DIR dir;
|
||||
result = f_opendir(&dir, MODELS_PATH);
|
||||
if (result != FR_OK) {
|
||||
if (result == FR_NO_PATH)
|
||||
result = f_mkdir(MODELS_PATH);
|
||||
if (result != FR_OK) {
|
||||
g_logState = -result;
|
||||
g_logError = PSTR("Check " MODELS_PATH " folder");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Loop, skipping over any existing log files ... _000, _001, etc. until we have a unique file name
|
||||
while (1)
|
||||
{
|
||||
|
||||
+3
-2
@@ -34,9 +34,10 @@
|
||||
#ifndef LOGS_H
|
||||
#define LOGS_H
|
||||
|
||||
#define LOG_PATH "/O9XLOGS" // no trailing slash = important
|
||||
#define LOG_PATH "/9XLOGS" // no trailing slash = important
|
||||
#define MODELS_PATH "/9XMODELS"
|
||||
|
||||
extern char g_logFilename[21]; // "/O9XLOGS/M00_000.CSV\0" max required length = 21
|
||||
extern char g_logFilename[21]; // "/9XLOGS/M00_000.CSV\0" max required length = 21
|
||||
extern int8_t g_logState; // 0=closed, >0 = opened, <0 is error
|
||||
extern FATFS g_FATFS_Obj;
|
||||
extern FIL g_oLogFile;
|
||||
|
||||
+6
-5
@@ -93,7 +93,7 @@ void menuMainView(uint8_t event)
|
||||
break;
|
||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||
case EVT_KEY_BREAK(KEY_LEFT):
|
||||
if (view_base == e_inputs) {
|
||||
if (view_base <= e_inputs) {
|
||||
g_eeGeneral.view ^= ALTERNATE_VIEW;
|
||||
eeDirty(EE_GENERAL);
|
||||
AUDIO_KEYPAD_UP();
|
||||
@@ -235,11 +235,10 @@ void menuMainView(uint8_t event)
|
||||
}
|
||||
}
|
||||
|
||||
if(view_base<e_inputs) {
|
||||
for(uint8_t i=0; i<8; i++)
|
||||
{
|
||||
if (view_base < e_inputs) {
|
||||
for (uint8_t i=0; i<8; i++) {
|
||||
uint8_t x0,y0;
|
||||
int16_t val = g_chans512[i];
|
||||
int16_t val = g_chans512[(g_eeGeneral.view & ALTERNATE_VIEW) ? 8+i : i];
|
||||
|
||||
switch(view_base)
|
||||
{
|
||||
@@ -254,6 +253,7 @@ void menuMainView(uint8_t event)
|
||||
lcd_outdezAtt( x0+4*FW , y0, GPERC(val)/10, 0); // G: Don't like the decimal part*
|
||||
#endif
|
||||
break;
|
||||
|
||||
case e_outputBars:
|
||||
#define WBAR2 (50/2)
|
||||
x0 = i<4 ? 128/4+2 : 128*3/4-2;
|
||||
@@ -337,4 +337,5 @@ void menuMainView(uint8_t event)
|
||||
#endif
|
||||
|
||||
DISPLAY_PROGRESS_BAR(20*FW+1);
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -528,18 +528,20 @@ void displayConfirmation(uint8_t event)
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * s_menu[MENU_MAX_LINES] = { 0, 0, 0, 0 };
|
||||
const char *s_menu[MENU_MAX_LINES];
|
||||
char s_bss_menu[MENU_MAX_LINES*MENU_LINE_LENGTH];
|
||||
uint8_t s_menu_item = 0;
|
||||
uint8_t s_menu_count = 0;
|
||||
const pm_char * displayMenu(uint8_t event)
|
||||
uint8_t s_menu_flags;
|
||||
const char * displayMenu(uint8_t event)
|
||||
{
|
||||
const pm_char * result = NULL;
|
||||
const char * result = NULL;
|
||||
|
||||
lcd_filled_rect(10, 16, 108, s_menu_count * (FH+1) + 2, SOLID, WHITE);
|
||||
lcd_rect(10, 16, 108, s_menu_count * (FH+1) + 2);
|
||||
|
||||
for (uint8_t i=0; i<s_menu_count; i++) {
|
||||
lcd_puts(16, i*(FH+1) + 2*FH + 2, s_menu[i]);
|
||||
lcd_putsAtt(16, i*(FH+1) + 2*FH + 2, s_menu[i], s_menu_flags);
|
||||
if (i == s_menu_item) lcd_filled_rect(11, i*(FH+1) + 2*FH + 1, 106, 9);
|
||||
}
|
||||
|
||||
@@ -550,16 +552,14 @@ const pm_char * displayMenu(uint8_t event)
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
if (s_menu_item < s_menu_count - 1) s_menu_item++;
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
result = s_menu[s_menu_item];
|
||||
// no break
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
killEvents(event);
|
||||
s_menu_item = 0;
|
||||
s_menu_count = 0;
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
killEvents(event);
|
||||
result = s_menu[s_menu_item];
|
||||
s_menu_count = 0;
|
||||
s_menu_item = 0;
|
||||
s_menu_flags = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -188,9 +188,12 @@ void displayConfirmation(uint8_t event);
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define MENU_MAX_LINES 4
|
||||
extern const pm_char * s_menu[];
|
||||
#define MENU_LINE_LENGTH (8+1)
|
||||
extern const char *s_menu[MENU_MAX_LINES];
|
||||
extern char s_bss_menu[MENU_MAX_LINES*MENU_LINE_LENGTH];
|
||||
extern uint8_t s_menu_count;
|
||||
const pm_char * displayMenu(uint8_t event);
|
||||
extern uint8_t s_menu_flags;
|
||||
const char * displayMenu(uint8_t event);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+72
-19
@@ -125,6 +125,51 @@ inline int8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
#ifdef SDCARD
|
||||
// TODO to be elsewhere if common to many menus
|
||||
const pm_char * s_sdcard_error = NULL;
|
||||
|
||||
bool listSDcardModels()
|
||||
{
|
||||
FILINFO fno;
|
||||
DIR dir;
|
||||
char *fn; /* This function is assuming non-Unicode cfg. */
|
||||
#if _USE_LFN
|
||||
static char lfn[_MAX_LFN + 1];
|
||||
fno.lfname = lfn;
|
||||
fno.lfsize = sizeof lfn;
|
||||
#endif
|
||||
|
||||
s_menu_count = 0;
|
||||
s_menu_flags = BSS;
|
||||
|
||||
FRESULT res = f_opendir(&dir, MODELS_PATH); /* Open the directory */
|
||||
if (res == FR_OK) {
|
||||
for (;;) {
|
||||
res = f_readdir(&dir, &fno); /* Read a directory item */
|
||||
if (res != FR_OK || fno.fname[0] == 0) break; /* Break on error or end of dir */
|
||||
if (fno.fname[0] == '.') continue; /* Ignore dot entry */
|
||||
#if _USE_LFN
|
||||
fn = *fno.lfname ? fno.lfname : fno.fname;
|
||||
#else
|
||||
fn = fno.fname;
|
||||
#endif
|
||||
if (~fno.fattrib & AM_DIR) { /* It is a file. */
|
||||
char *menu_entry = &s_bss_menu[s_menu_count*MENU_LINE_LENGTH];
|
||||
memset(menu_entry, 0, MENU_LINE_LENGTH);
|
||||
for (uint8_t i=0; i<MENU_LINE_LENGTH-1; i++) {
|
||||
if (fn[i] == '.')
|
||||
break;
|
||||
menu_entry[i] = fn[i];
|
||||
}
|
||||
s_menu[s_menu_count++] = menu_entry;
|
||||
// TODO better handling...
|
||||
if (s_menu_count == MENU_MAX_LINES)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return s_menu_count;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void menuProcModelSelect(uint8_t event)
|
||||
@@ -372,27 +417,35 @@ void menuProcModelSelect(uint8_t event)
|
||||
}
|
||||
|
||||
if (s_menu_count) {
|
||||
const pm_char * result = displayMenu(event);
|
||||
const char * result = displayMenu(event);
|
||||
if (result) {
|
||||
if (result == STR_LOAD_MODEL || result == STR_CREATE_MODEL) {
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
if (s_menu_flags) {
|
||||
// The user choosed a file on SD
|
||||
}
|
||||
else {
|
||||
if (result == STR_LOAD_MODEL || result == STR_CREATE_MODEL) {
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
}
|
||||
else if (result == STR_ARCHIVE_MODEL) {
|
||||
s_sdcard_error = eeArchiveModel(sub);
|
||||
/* TODO as soon as archive and restore do work! if (!s_sdcard_error)
|
||||
eeDeleteModel(sub); // delete the model, it's archived!
|
||||
*/
|
||||
}
|
||||
else if (result == STR_RESTORE_MODEL) {
|
||||
if (!listSDcardModels()) {
|
||||
s_sdcard_error = PSTR("No Models on SD");
|
||||
}
|
||||
}
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
s_warning = STR_DELETEMODEL;
|
||||
}
|
||||
}
|
||||
else if (result == STR_ARCHIVE_MODEL) {
|
||||
s_sdcard_error = eeArchiveModel(sub);
|
||||
if (!s_sdcard_error)
|
||||
eeDeleteModel(sub); // delete the model, it's archived!
|
||||
}
|
||||
else if (result == STR_RESTORE_MODEL) {
|
||||
// TODO
|
||||
}
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
s_warning = STR_DELETEMODEL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -282,6 +282,7 @@ enum TelemetryUnit {
|
||||
UNIT_KMH,
|
||||
UNIT_MPH,
|
||||
UNIT_METERS,
|
||||
UNIT_FEET = UNIT_METERS,
|
||||
UNIT_DEGREES,
|
||||
UNIT_PERCENT,
|
||||
UNIT_MILLIAMPS,
|
||||
@@ -313,6 +314,7 @@ enum TelemetrySource {
|
||||
TELEM_T2,
|
||||
TELEM_SPEED,
|
||||
TELEM_DIST,
|
||||
TELEM_GPSALT,
|
||||
TELEM_CELL,
|
||||
TELEM_ACCx,
|
||||
TELEM_ACCy,
|
||||
@@ -474,7 +476,7 @@ enum Dsm2Variants {
|
||||
#endif
|
||||
|
||||
PACK(typedef struct t_ModelData {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
char name[10]; // must be first for eeLoadModelName
|
||||
TimerData timers[MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
|
||||
+5
-1
@@ -83,7 +83,7 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define OFS_VALARM (OFS_VTELEMUNIT + sizeof(TR_VTELEMUNIT))
|
||||
#define OFS_VALARMFN (OFS_VALARM + sizeof(TR_VALARM))
|
||||
#define OFS_VTELPROTO (OFS_VALARMFN + sizeof(TR_VALARMFN))
|
||||
#define OFS_GPSFORMAT (OFS_VTELPROTO + sizeof(TR_VTELPROTO))
|
||||
#define OFS_GPSFORMAT (OFS_VTELPROTO + sizeof(TR_VTELPROTO))
|
||||
#define OFS_ENDTELEM (OFS_GPSFORMAT + sizeof(TR_GPSFORMAT))
|
||||
#else
|
||||
#define OFS_ENDTELEM (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS))
|
||||
@@ -265,6 +265,7 @@ extern const pm_char STR_RXCHANNELORD[];
|
||||
extern const pm_char STR_SLAVE[];
|
||||
extern const pm_char STR_MODESRC[];
|
||||
extern const pm_char STR_MULTIPLIER[];
|
||||
#define LEN_MULTIPLIER PSIZE(TR_MULTIPLIER)
|
||||
extern const pm_char STR_CAL[];
|
||||
extern const pm_char STR_EEPROMV[];
|
||||
extern const pm_char STR_VTRIM[];
|
||||
@@ -359,6 +360,9 @@ extern const pm_char STR_BATT_CALIB[];
|
||||
#if defined(PCBARM)
|
||||
extern const pm_char STR_CURRENT_CALIB[];
|
||||
extern const pm_char STR_CURRENT[];
|
||||
#define LEN_CALIB_FIELDS (PSIZE(TR_BATT_CALIB) > PSIZE(TR_CURRENT_CALIB) ? PSIZE(TR_BATT_CALIB) : PSIZE(TR_CURRENT_CALIB))
|
||||
#else
|
||||
#define LEN_CALIB_FIELDS PSIZE(TR_BATT_CALIB)
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
|
||||
+2
-1
@@ -426,8 +426,9 @@ int16_t getValue(uint8_t i)
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_FUEL) return frskyHubData.fuelLevel;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_T1) return frskyHubData.temperature1;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_T2) return frskyHubData.temperature2;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_SPEED) return frskyHubData.gpsSpeed_ap;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_SPEED) return frskyHubData.gpsSpeed_bp;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_DIST) return frskyHubData.gpsDistance;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_GPSALT) return frskyHubData.gpsAltitude_bp;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_CELL) return (int16_t)frskyHubData.minCellVolts * 2;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_ACCx) return frskyHubData.accelX;
|
||||
else if(i<CSW_CHOUT_BASE+NUM_CHNOUT+TELEM_ACCy) return frskyHubData.accelY;
|
||||
|
||||
@@ -110,10 +110,16 @@
|
||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0 ""mA\0"
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#endif
|
||||
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h" LENGTH_UNIT "@\0 ""%\0 ""mA\0"
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -131,7 +137,7 @@
|
||||
#endif
|
||||
|
||||
#define LEN_GPSFORMAT "\004"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
|
||||
#define LEN2_VTEMPLATES 13
|
||||
#define LEN_VTEMPLATES "\015"
|
||||
|
||||
@@ -110,10 +110,10 @@
|
||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Time"
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0 ""mA\0"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0 ""mA\0""ft\0"
|
||||
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
@@ -132,7 +132,10 @@
|
||||
#endif
|
||||
|
||||
#define LEN_GPSFORMAT "\004"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
|
||||
#define LEN_VUNITSFORMAT "\004"
|
||||
#define TR_VUNITSFORMAT "MetrImpr"
|
||||
|
||||
#define LEN2_VTEMPLATES 15
|
||||
#define LEN_VTEMPLATES "\017"
|
||||
@@ -339,6 +342,7 @@
|
||||
#define TR_LATITUDE "Latitude"
|
||||
#define TR_LONGITUDE "Longitude"
|
||||
#define TR_GPSCOORD "Gps Coords"
|
||||
#define TR_UNITSFORMAT "Units Format"
|
||||
#define TR_SHUTDOWN "ARRET EN COURS"
|
||||
#define TR_BATT_CALIB "Calib. Batterie"
|
||||
#define TR_CURRENT_CALIB "Calib. Amperage"
|
||||
|
||||
@@ -110,10 +110,10 @@
|
||||
#define TR_FUNCSOUNDS "Varn1 ""Varn2 ""F\200r ""Ring ""SciFi ""Robot ""Pip ""Tada ""Syrsa ""Siren ""Alarm ""Ratata""Tick ""Vibr1 ""Vibr2 ""Vibr3 "
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Tank""T1\0 ""T2\0 ""Spd\0""Dist""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Tid\0"
|
||||
#define TR_VTELEMCHNS "---\0""Tmr1""Tmr2""A1\0 ""A2\0 ""Tx\0 ""Rx\0 ""Alt\0""Rpm\0""Tank""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Acc\0""Tid\0"
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0 ""mA\0"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0 ""mA\0""ft\0"
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -131,7 +131,10 @@
|
||||
#endif
|
||||
|
||||
#define LEN_GPSFORMAT "\004"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
|
||||
#define LEN_VUNITSFORMAT "\004"
|
||||
#define TR_VUNITSFORMAT "MetrImpr"
|
||||
|
||||
#define LEN2_VTEMPLATES 13
|
||||
#define LEN_VTEMPLATES "\015"
|
||||
@@ -338,6 +341,7 @@
|
||||
#define TR_LATITUDE "Breddgrad"
|
||||
#define TR_LONGITUDE "L\201ngdgrad"
|
||||
#define TR_GPSCOORD "GPS-Koord."
|
||||
#define TR_UNITSFORMAT "Units Format"
|
||||
#define TR_SHUTDOWN "ST\204NGER AV"
|
||||
#define TR_BATT_CALIB "Battery Calib"
|
||||
#define TR_CURRENT_CALIB "Current Calib"
|
||||
|
||||
Reference in New Issue
Block a user