From 48b350a8c275728ca6dd505f08d65731a764486d Mon Sep 17 00:00:00 2001 From: "romolo.manfredini@gmail.com" Date: Thu, 4 Oct 2012 13:22:30 +0000 Subject: [PATCH] Coproc related info relocated --- src/general_menus.cpp | 16 ++++++++-------- src/simu.cpp | 7 ++++--- src/sky9x/sound_driver.cpp | 3 +++ src/sky9x/sound_driver.h | 1 + src/statistics_views.cpp | 21 ++++++++++++++++----- src/translations.cpp | 1 + src/translations.h | 1 + src/translations/cz.h | 1 + src/translations/de.h | 1 + src/translations/en.h | 1 + src/translations/fr.h | 1 + src/translations/it.h | 1 + src/translations/se.h | 1 + 13 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/general_menus.cpp b/src/general_menus.cpp index 47f2407c5..4a78c2d9d 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -776,6 +776,14 @@ void menuGeneralVersion(uint8_t event) lcd_putsLeft(3*FH, stamp2); lcd_putsLeft(4*FH, stamp3); lcd_putsLeft(5*FH, stamp4); +#if defined(PCBSKY9X) + if (Coproc_valid!=1) { + lcd_putsLeft(6*FH, PSTR("CoPr:")); + lcd_outdez8(10*FW, 6*FH, Coproc_read); + } else { + lcd_putsLeft(6*FH, PSTR("CoPr: ---")); + } +#endif lcd_putsLeft(7*FH, STR_EEPROMV); lcd_outdezAtt(8*FW, 7*FH, g_eeGeneral.myVers, LEFT); } @@ -883,7 +891,6 @@ void menuGeneralDiagAna(uint8_t event) #if defined(PCBSKY9X) enum menuGeneralHwItems { - ITEM_SETUP_HW_COPROC, ITEM_SETUP_HW_OPTREX_DISPLAY, ITEM_SETUP_HW_MAX }; @@ -902,13 +909,6 @@ void menuGeneralHardware(uint8_t event) uint8_t attr = (sub == k ? blink : 0); switch(k) { - case ITEM_SETUP_HW_COPROC: - lcd_putsLeft(y, STR_COPROC); - lcd_outhex4(GENERAL_HW_PARAM_OFS, y, (Coproc_valid << 8) + Coproc_read); - lcd_putsLeft(y+FH*2, "Coproc temp"); - putsTelemetryValue(GENERAL_HW_PARAM_OFS+3*FW-2, y+FH*2, Coproc_temp, UNIT_DEGREES,0) ; - break; - case ITEM_SETUP_HW_OPTREX_DISPLAY: // TODO remove STR_OPTREX_DISPLAY + translations here g_eeGeneral.optrexDisplay = selectMenuItem(GENERAL_HW_PARAM_OFS, y, PSTR("LCD"), PSTR("\006NormalOptrex"), g_eeGeneral.optrexDisplay, 0, 1, attr, event); diff --git a/src/simu.cpp b/src/simu.cpp index 52500a473..fc0d6d3ca 100644 --- a/src/simu.cpp +++ b/src/simu.cpp @@ -274,9 +274,10 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) ERSKY9X_EXIT_PIO->PIO_PDSR |= ERSKY9X_EXIT_MASK; PIOB->PIO_PDSR |= ERSKY9X_MENU_MASK; // PIOA->PIO_PDSR = 0xFFFFFFFF; - temperature = 67; - Coproc_temp = 45; - maxTemperature = 70; + temperature = 31; + Coproc_temp = 23; + Coproc_maxtemp = 28; + maxTemperature = 42; #elif defined(PCBGRUVIN9X) uint8_t pin = (pinl & ~0x3f); diff --git a/src/sky9x/sound_driver.cpp b/src/sky9x/sound_driver.cpp index 0687fe299..960625534 100644 --- a/src/sky9x/sound_driver.cpp +++ b/src/sky9x/sound_driver.cpp @@ -249,6 +249,7 @@ static uint8_t CoProc_appgo_pending ; uint8_t Volume_read ; uint8_t Coproc_read ; int8_t Coproc_temp ; +int8_t Coproc_maxtemp=-127 ; int8_t Coproc_valid ; bool get_onlytemp; static uint8_t *Twi_read_address ; @@ -452,6 +453,8 @@ extern "C" void TWI0_IRQHandler() g_rtcTime = gmktime(&utm); } Coproc_temp = Co_proc_status[8]; + if (Coproc_temp > Coproc_maxtemp) + Coproc_maxtemp=Coproc_temp; } TWI0->TWI_PTCR = TWI_PTCR_RXTDIS ; // Stop transfers if ( TWI0->TWI_SR & TWI_SR_RXRDY ) { diff --git a/src/sky9x/sound_driver.h b/src/sky9x/sound_driver.h index 487e6e969..a0373a75a 100644 --- a/src/sky9x/sound_driver.h +++ b/src/sky9x/sound_driver.h @@ -51,6 +51,7 @@ extern void read_coprocessor( bool onlytemp=false ) ; extern uint8_t Coproc_read ; extern int8_t Coproc_valid ; extern int8_t Coproc_temp ; +extern int8_t Coproc_maxtemp ; extern uint16_t *nextAudioData; extern uint16_t nextAudioSize; diff --git a/src/statistics_views.cpp b/src/statistics_views.cpp index 56c003dca..f5e53fc28 100644 --- a/src/statistics_views.cpp +++ b/src/statistics_views.cpp @@ -130,8 +130,21 @@ void menuStatisticsDebug(uint8_t event) lcd_putsLeft(3*FH, STR_CPU_TEMP); putsTelemetryValue(MENU_DEBUG_COL_OFS, 3*FH, getTemperature(), UNIT_DEGREES, 0); putsTelemetryValue(20*FW+2, 3*FH, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_DEGREES, 0); - lcd_putsLeft(4*FH, STR_TMAINMAXMS); - lcd_outdezAtt(MENU_DEBUG_COL_OFS, 4*FH, (g_timeMainMax)/20, PREC2); + lcd_putsLeft(4*FH, STR_COPROC_TEMP); + if (Coproc_read>2) { + putsTelemetryValue(MENU_DEBUG_COL_OFS, 4*FH, Coproc_temp, UNIT_DEGREES, 0); + } else { + lcd_puts(MENU_DEBUG_COL_OFS-2*FW,4*FH,PSTR("---")); + } + if (Coproc_maxtemp!=-127) { + putsTelemetryValue(20*FW+2, 4*FH, Coproc_maxtemp, UNIT_DEGREES, 0); + } else { + lcd_puts(18*FW+2,4*FH,PSTR("---")); + } + lcd_putsLeft(5*FH, STR_TMAINMAXMS); + lcd_outdezAtt(MENU_DEBUG_COL_OFS, 5*FH, (g_timeMainMax)/20, PREC2); + lcd_putsLeft(6*FH, STR_FREESTACKMINB); + lcd_outdezAtt(14*FW, 6*FH, stack_free(), UNSIGN) ; #else lcd_putsLeft(1*FH, STR_TMR1LATMAXUS); lcd_outdez8(MENU_DEBUG_COL_OFS , 1*FH, g_tmr1Latency_max/2 ); @@ -141,10 +154,8 @@ void menuStatisticsDebug(uint8_t event) lcd_outdez8(MENU_DEBUG_COL_OFS , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 ); lcd_putsLeft(4*FH, STR_TMAINMAXMS); lcd_outdezAtt(MENU_DEBUG_COL_OFS, 4*FH, (g_timeMainMax*100)/16, PREC2); -#endif - lcd_putsLeft(5*FH, STR_FREESTACKMINB); lcd_outdezAtt(14*FW, 5*FH, stack_free(), UNSIGN) ; - +#endif lcd_puts(3*FW, 7*FH, STR_MENUTORESET); } diff --git a/src/translations.cpp b/src/translations.cpp index 7a44829d6..344bb85e1 100644 --- a/src/translations.cpp +++ b/src/translations.cpp @@ -343,6 +343,7 @@ const pm_char STR_CPU_TEMP[] PROGMEM = TR_CPU_TEMP; const pm_char STR_CPU_CURRENT[] PROGMEM = TR_CPU_CURRENT; const pm_char STR_CPU_MAH[] PROGMEM = TR_CPU_MAH; const pm_char STR_COPROC[] PROGMEM = TR_COPROC; +const pm_char STR_COPROC_TEMP[] PROGMEM = TR_COPROC_TEMP; const pm_char STR_TEMPWARNING[] PROGMEM = TR_TEMPWARNING; const pm_char STR_CAPAWARNING[] PROGMEM = TR_CAPAWARNING; const pm_char STR_FUNC[] PROGMEM = TR_FUNC; diff --git a/src/translations.h b/src/translations.h index c400a8ffc..3d776a9fb 100644 --- a/src/translations.h +++ b/src/translations.h @@ -424,6 +424,7 @@ extern const pm_char STR_CPU_TEMP[]; extern const pm_char STR_CPU_CURRENT[]; extern const pm_char STR_CPU_MAH[]; extern const pm_char STR_COPROC[]; +extern const pm_char STR_COPROC_TEMP[]; extern const pm_char STR_CAPAWARNING[]; extern const pm_char STR_TEMPWARNING[]; extern const pm_char STR_FUNC[]; diff --git a/src/translations/cz.h b/src/translations/cz.h index b2c5fd8c5..870ca4d26 100644 --- a/src/translations/cz.h +++ b/src/translations/cz.h @@ -417,6 +417,7 @@ #define TR_CPU_CURRENT "Current\011>" #define TR_CPU_MAH "Consumpt." #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "tepl. MB \007>" #define TR_CAPAWARNING "Capacity Warning" #define TR_TEMPWARNING "Temp Warning" #define TR_FUNC "Fun." diff --git a/src/translations/de.h b/src/translations/de.h index d5f42d065..b0383c671 100644 --- a/src/translations/de.h +++ b/src/translations/de.h @@ -417,6 +417,7 @@ #define TR_CPU_CURRENT "Current\011>" #define TR_CPU_MAH "Consumpt." #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "MB temp. \007>" #define TR_CAPAWARNING "Capacity Warning" #define TR_TEMPWARNING "Temp Warning" #define TR_FUNC "Func" diff --git a/src/translations/en.h b/src/translations/en.h index 7d4190bc6..382cfb028 100644 --- a/src/translations/en.h +++ b/src/translations/en.h @@ -422,6 +422,7 @@ #define TR_CPU_CURRENT "Current\011>" #define TR_CPU_MAH "Consumpt." #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "MB Temp. \007>" #define TR_CAPAWARNING "Capacity Warning" #define TR_TEMPWARNING "Temp Warning" #define TR_FUNC "Func" diff --git a/src/translations/fr.h b/src/translations/fr.h index eaaedc6a2..e1deea953 100644 --- a/src/translations/fr.h +++ b/src/translations/fr.h @@ -416,6 +416,7 @@ #define TR_CPU_CURRENT "Courant\011>" #define TR_CPU_MAH "Consomm." #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "Temp. MB \007>" #define TR_CAPAWARNING "Capacity Warning" #define TR_TEMPWARNING "Alarme temp" #define TR_FUNC "Fonc" diff --git a/src/translations/it.h b/src/translations/it.h index 0292fb6b5..a4ac542fa 100644 --- a/src/translations/it.h +++ b/src/translations/it.h @@ -417,6 +417,7 @@ #define TR_CPU_CURRENT "Corrente\011>" #define TR_CPU_MAH "Consumo" #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "Temp. MB \007>" #define TR_CAPAWARNING "Avviso Capacita'" #define TR_TEMPWARNING "Avviso Temp." #define TR_FUNC "Funz" diff --git a/src/translations/se.h b/src/translations/se.h index cae05b2ff..abafac908 100644 --- a/src/translations/se.h +++ b/src/translations/se.h @@ -415,6 +415,7 @@ #define TR_CPU_CURRENT "Str\202m\013>" #define TR_CPU_MAH "F\202rbrukn." #define TR_COPROC "CoProc." +#define TR_COPROC_TEMP "MB temp. \007>" #define TR_CAPAWARNING "Kapacitetsvarning" #define TR_TEMPWARNING "Tempvarning " #define TR_FUNC "Funk"