comparison Discovery/Src/t7.c @ 200:7116c0ffb862

Merged in janlmulder/ostc4/div-fixes-cleaup-2 (pull request #8) 2 (simple) bugfixes and again some cleanup
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Fri, 22 Mar 2019 08:15:30 +0000
parents 878dc9e0dbc5
children b2a9e9b02df0
comparison
equal deleted inserted replaced
195:05df3b395615 200:7116c0ffb862
56 void t7_debug(void); 56 void t7_debug(void);
57 57
58 void t7_miniLiveLogProfile(void); 58 void t7_miniLiveLogProfile(void);
59 //void t7_clock(void); 59 //void t7_clock(void);
60 void t7_logo_OSTC(void); 60 void t7_logo_OSTC(void);
61 void t7_colorscheme_mod(char *text); 61 static void t7_colorscheme_mod(char *text);
62 62
63 uint8_t t7_test_customview_warnings(void); 63 uint8_t t7_test_customview_warnings(void);
64 void t7_show_customview_warnings(void); 64 void t7_show_customview_warnings(void);
65 65
66 uint8_t t7_test_customview_warnings_surface_mode(void); 66 uint8_t t7_test_customview_warnings_surface_mode(void);
1205 1205
1206 char TextL1[4*TEXTSIZE]; 1206 char TextL1[4*TEXTSIZE];
1207 uint32_t color; 1207 uint32_t color;
1208 // uint8_t gasIdFirst; 1208 // uint8_t gasIdFirst;
1209 SSettings* pSettings = settingsGetPointer(); 1209 SSettings* pSettings = settingsGetPointer();
1210 extern SDataExchangeSlaveToMaster dataIn; 1210 SDataExchangeSlaveToMaster *dataIn = get_dataInPointer();
1211 1211
1212 SWindowGimpStyle windowGimp; 1212 SWindowGimpStyle windowGimp;
1213 1213
1214 RTC_DateTypeDef Sdate; 1214 RTC_DateTypeDef Sdate;
1215 RTC_TimeTypeDef Stime; 1215 RTC_TimeTypeDef Stime;
1219 1219
1220 1220
1221 if(stateUsed->data_old__lost_connection_to_slave) 1221 if(stateUsed->data_old__lost_connection_to_slave)
1222 { 1222 {
1223 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old"); 1223 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old");
1224 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn.header.checkCode[0],dataIn.header.checkCode[1],dataIn.header.checkCode[2],dataIn.header.checkCode[3]); 1224 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]);
1225 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1); 1225 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1);
1226 } 1226 }
1227 else 1227 else
1228 if(DataEX_lost_connection_count()) 1228 if(DataEX_lost_connection_count())
1229 { 1229 {
1259 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); 1259 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT);
1260 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure"); 1260 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure");
1261 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1); 1261 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1);
1262 1262
1263 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings; 1263 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings;
1264 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn.RTE_VERSION_high,dataIn.RTE_VERSION_low); 1264 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn->RTE_VERSION_high,dataIn->RTE_VERSION_low);
1265 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE"); 1265 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE");
1266 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1); 1266 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1);
1267 1267
1268 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery"); 1268 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery");
1269 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage); 1269 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage);
2637 2637
2638 text[textptr] = 0; 2638 text[textptr] = 0;
2639 return lineCount; 2639 return lineCount;
2640 } 2640 }
2641 2641
2642 /* could be extended to search for \020 inside 2642 static void t7_colorscheme_mod(char *text) {
2643 */ 2643 char *p = text;
2644 void t7_colorscheme_mod(char *text) 2644 while (*p) {
2645 { 2645 if ((*p == '\020') && !GFX_is_colorschemeDiveStandard())
2646 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard()) 2646 *p = '\027';
2647 { 2647 p++;
2648 text[0] = '\027'; 2648 }
2649 }
2650 } 2649 }
2651 2650
2652 2651
2653 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide) 2652 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide)
2654 { 2653 {
3104 text[textpointer++] = '\n'; 3103 text[textpointer++] = '\n';
3105 text[textpointer++] = '\r'; 3104 text[textpointer++] = '\r';
3106 text[textpointer++] = '\t'; 3105 text[textpointer++] = '\t';
3107 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60); 3106 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60);
3108 text[textpointer++] = 0; 3107 text[textpointer++] = 0;
3108 t7_colorscheme_mod(text);
3109 GFX_write_string(&FontT42, &t7cY0free, text, 1); 3109 GFX_write_string(&FontT42, &t7cY0free, text, 1);
3110 } 3110 }
3111 3111
3112 3112
3113 3113