From c66fab2e6d67f360ca8828f6d4f168956aef71ad Mon Sep 17 00:00:00 2001 From: "bernet.andre@gmail.com" Date: Tue, 5 Mar 2013 00:06:22 +0000 Subject: [PATCH] [X9D] 10 characters for audio files, 3-column on custom telemetry screens --- src/Makefile | 1 + src/frsky.cpp | 17 ++++++++++++++--- src/model_menus.cpp | 21 +++++++++++++++------ src/myeeprom.h | 14 ++++++++++++-- 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index d2f8d725e..33658d696 100644 --- a/src/Makefile +++ b/src/Makefile @@ -277,6 +277,7 @@ ifeq ($(PCB), X9D) MCU = cortex-m3 CPPDEFS += -DHSE_VALUE=12000000 SDCARD = YES + EXT = FRSKY endif CC = $(TRGT)gcc diff --git a/src/frsky.cpp b/src/frsky.cpp index 163fc3a03..7b3e6a114 100644 --- a/src/frsky.cpp +++ b/src/frsky.cpp @@ -1355,10 +1355,15 @@ void menuTelemetryFrsky(uint8_t event) // Custom Screen with numbers uint8_t fields_count = 0; for (uint8_t i=0; i<4; i++) { - for (uint8_t j=0; j<2; j++) { + for (uint8_t j=0; j 0) { #if defined(FRSKY_HUB) if (field == TELEM_ACC) { @@ -1388,8 +1393,14 @@ void menuTelemetryFrsky(uint8_t event) putsTime(x, 1+FH+2*FH*i, value, att, att); } else { - putsTelemetryChannel(j ? 128 : 63, i==3 ? 1+7*FH : 1+2*FH+2*FH*i, field-1, value, att); - lcd_putsiAtt(j*65, 1+FH+2*FH*i, STR_VTELEMCHNS, field, 0); + uint8_t pos[NUM_LINE_ITEMS]; +#if !defined(PCBX9D) + pos[0] = 0; pos[1] = 63; pos[2] = 128;// {0, 63, 128}; +#else + pos[0] = 0; pos[1] = 70; pos[2] = 140; pos[3] = 212;// {0, 70, 140, 212}; +#endif + putsTelemetryChannel(pos[j+1], i==3 ? 1+7*FH : 1+2*FH+2*FH*i, field-1, value, att); + lcd_putsiAtt(j?pos[j]+2:0, 1+FH+2*FH*i, STR_VTELEMCHNS, field, 0); } } } diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 05fda8010..627b57dd3 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -3573,9 +3573,9 @@ void menuModelCustomFunctions(uint8_t event) else if (sd->swtch && CFN_FUNC(sd) >= FUNC_PLAY_TRACK && CFN_FUNC(sd) <= FUNC_PLAY_VALUE) { #if defined(CPUARM) if (CFN_PLAY_REPEAT(sd)) - lcd_outdezAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2+FW, y, CFN_PLAY_REPEAT(sd)*5, attr); + lcd_outdezAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2+5*FW, y, CFN_PLAY_REPEAT(sd)*5, attr); else - lcd_putcAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+1, y, '-', attr); + lcd_putcAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+1+4*FW, y, '-', attr); if (active) CHECK_INCDEC_MODELVAR_ZERO(event, CFN_PLAY_REPEAT(sd), 12); #else if (CFN_PLAY_REPEAT(sd)) @@ -3666,7 +3666,8 @@ enum menuModelTelemetryItems { #ifdef FRSKY #if LCD_W >= 212 -#define TELEM_COL2 (LCD_W-17*FW-MENUS_SCROLLBAR_WIDTH) +#define TELEM_COL2 14*FW +#define TELEM_COL3 29*FW #elif defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_CZ) #define TELEM_COL2 (9*FW) #else @@ -3953,14 +3954,22 @@ void menuModelTelemetry(uint8_t event) } } else { - for (uint8_t c=0; c<2; c++) { + for (uint8_t c=0; c0 || p1valdiff)) { CHECK_INCDEC_MODELVAR_ZERO(event, value, g_model.frsky.usrProto ? ((lineIndex==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX) : TELEM_NOUSR_MAX); } } - if (attr && m_posHorz == 2) { + if (attr && m_posHorz == NUM_LINE_ITEMS) { REPEAT_LAST_CURSOR_MOVE(); } } diff --git a/src/myeeprom.h b/src/myeeprom.h index 0c3a91ce8..dc96ca776 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -408,11 +408,16 @@ enum ResetFunctionParam { }; #if defined(CPUARM) +#if defined(PCBX9D) + #define LEN_CFN_NAME 10 +#else + #define LEN_CFN_NAME 6 +#endif PACK(typedef struct t_CustomFnData { // Function Switches data int8_t swtch; uint8_t func; union { - char name[6]; + char name[LEN_CFN_NAME]; struct { uint32_t val; uint16_t spare; @@ -579,8 +584,13 @@ PACK(typedef struct t_FrSkyBarData { uint8_t barMax; // ditto for max display (would usually = ratio) }) FrSkyBarData; +#if defined(PCBX9D) + #define NUM_LINE_ITEMS 3 +#else + #define NUM_LINE_ITEMS 2 +#endif PACK(typedef struct t_FrSkyLineData { - uint8_t sources[2]; + uint8_t sources[NUM_LINE_ITEMS]; }) FrSkyLineData; typedef union t_FrSkyScreenData {