Skip to content

Commit 78339d7

Browse files
author
Wegmann Peter
committed
time estimation works now includong european daylight savings
1 parent 03f5828 commit 78339d7

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

DispAdapter.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ void paint_Main(void){
206206
paint_string_row_col(strBuff,VERSION,0,FGC);
207207

208208
if(Time.tm_year != 0){
209-
sprintf(strBuff,"%02i.%02i.%04i ", Time.tm_mday,Time.tm_mon,Time.tm_year);
210-
paint_string_row_col(strBuff,DATETIME,0,FGC);
209+
sprintf(strBuff,"%02i.%02i.%04i ", Time.tm_mday,Time.tm_mon,Time.tm_year);
210+
paint_string_row_col(strBuff,DATETIME,0,FGC);
211211
}
212212

213213
lcd_Print("Value :",X_LEFT_EDGE ,Y_VALUES_START + FONT2_H * VALUE ,2,1,1,FGC,BGC);
@@ -453,20 +453,19 @@ void displayTemPreVol(void){
453453

454454

455455

456+
457+
458+
sprintf(strBuff," %02i:%02i",Time.tm_hour, Time.tm_min);
459+
460+
461+
strcat(indStr,strBuff);
456462
if (connected.TWI && connected.DS3231M)
457463
{
458-
sprintf(strBuff," %02i:%02i",Time.tm_hour, Time.tm_min);
459-
}
460-
else
461-
{
462-
sprintf(strBuff," NoI2C");
464+
paint_string_row_col(indStr,DATETIME,11, FGC);
465+
466+
}else{
467+
paint_string_row_col(indStr,DATETIME,11, orange);
463468
}
464-
465-
strcat(indStr,strBuff);
466-
467-
paint_string_row_col(indStr,DATETIME,11, FGC);
468-
469-
470469

471470

472471

@@ -806,7 +805,7 @@ void reset_display(uint8_t clear)
806805
}
807806

808807
void paint_Date(void){
809-
sprintf(strBuff,"%02i.%02i.%04i ", Time.tm_mday,Time.tm_mon,Time.tm_year+2000);
810-
paint_string_row_col(strBuff,DATETIME,0,FGC);
811-
808+
sprintf(strBuff,"%02i.%02i.%04i ", Time.tm_mday,Time.tm_mon,Time.tm_year+2000);
809+
paint_string_row_col(strBuff,DATETIME,0,FGC);
810+
812811
}

Gascounter_main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ uint8_t ping_server(void)
12291229
SET_ERROR(NETWORK_ERROR);
12301230
ex_mode = offline;
12311231
t_start(RECONNECT,options.Ping_Intervall*60);
1232+
paint_Date();
12321233
return 0;
12331234
}
12341235
else
@@ -1346,7 +1347,14 @@ void Set_Options(uint8_t *optBuffer,uint8_t answer_code){
13461347
newtime.tm_mon = optBuffer[4];
13471348
newtime.tm_year = optBuffer[5];
13481349

1350+
1351+
13491352
DS3231M_set_time(&newtime);
1353+
1354+
_delay_ms(50);
1355+
1356+
DS3231M_read_time();
1357+
13501358
}
13511359
#ifdef DEBUG_DS3231M
13521360

@@ -1804,6 +1812,7 @@ int main(void)
18041812
{
18051813
xbee_coordIdentifier(); // get name of connected Coordinator
18061814
reset_display(0);
1815+
paint_Date();
18071816
//MEASUREMENT BLOCK
18081817
if (connected.BMP){ // measurement is only done if T OR P compensation is enabled
18091818
if(BMP_Temp_and_Pressure()){
@@ -2027,7 +2036,7 @@ int main(void)
20272036

20282037
if (t_check(I2C_CHECK))
20292038
{
2030-
t_start(I2C_CHECK,10);
2039+
t_start(I2C_CHECK,20);
20312040

20322041
if(!connected.TWI || !connected.DS3231M || (!connected.BMP && connected.BMP_on_Startup) || CHECK_ERROR(I2C_BUS_ERROR))
20332042
{
@@ -2276,6 +2285,7 @@ int main(void)
22762285
ISR(TIMER1_COMPA_vect)
22772286
{
22782287
count_t_elapsed++;
2288+
system_tick();
22792289
}
22802290

22812291
ISR(INT2_vect)

avr-util-library

Submodule avr-util-library updated from ee1ebbb to c5db8be

0 commit comments

Comments
 (0)