Skip to content

Commit bf2be1c

Browse files
author
Peter Wegmann
committed
Bug fixes
Bug fixes LAN GCM: - Node identifier respnse fix - offline on startup errormessage ajusted - wait time to connect coordinator increased to 5min general: - temp is now omitted when when no bmp sensor is connected - measurement is sent when volume is greater or equal delta vol
1 parent b778ecf commit bf2be1c

File tree

6 files changed

+203
-185
lines changed

6 files changed

+203
-185
lines changed

DispAdapter.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void paint_Main(void){
223223

224224

225225

226-
void paint_Value(uint64_t val,ROW_NAME row,uint8_t precision, uint8_t min_width,char* unit){
226+
void paint_Value(double val,ROW_NAME row,uint8_t precision, uint8_t min_width,char* unit){
227227
#ifdef ili9341
228228
char numberbuffer[30];
229229
dtostrf(((double)val)/pow(10,precision),min_width,precision,numberbuffer);
@@ -390,8 +390,14 @@ void displayTemPreVol(void){
390390
paint_string_row("",TEMP,1,"",white);
391391
sensor_err = 0;
392392
}
393-
394-
paint_Value( options.Temperature_value - 2732,TEMP, 1, 4, "°C");
393+
if (!options.T_Compensation_enable && !connected.BMP)
394+
{
395+
paint_string_row("/",TEMP,0,"",white);
396+
}
397+
else
398+
{
399+
paint_Value( ((double)options.Temperature_value) - 2732,TEMP, 1, 4, "°C");
400+
}
395401
}
396402
else{
397403

@@ -402,7 +408,13 @@ void displayTemPreVol(void){
402408
//PRESSURE
403409
if(!(options.p_Compensation_enable && (CHECK_ERROR(TEMPPRESS_ERROR))))
404410
{
405-
paint_Value(options.Pressure_value,PRESS, 1, 6, "mbar");
411+
if (!options.p_Compensation_enable && !connected.BMP)
412+
{
413+
paint_string_row("/",PRESS,0,"",white);
414+
}else{
415+
paint_Value(options.Pressure_value,PRESS, 1, 6, "mbar");
416+
}
417+
406418
}
407419
else{
408420

DispAdapter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void setInitScreen(uint16_t fore, uint16_t back, uint8_t nextLine, uint8_t FontN
8383
void paint_info_line(char * line, _Bool update);
8484
void paint_string_row_col(char *text,ROW_NAME row,uint8_t col, uint16_t color);
8585
void paint_string_row(char *text,ROW_NAME row,uint8_t update,char* unit,uint16_t color);
86-
void paint_Value(uint64_t val,ROW_NAME row,uint8_t precision, uint8_t min_width,char* unit);
86+
void paint_Value(double val,ROW_NAME row,uint8_t precision, uint8_t min_width,char* unit);
8787
void paint_Error(char* text, ROW_NAME row);
8888
void paint_Main(void);
8989
void InitScreen_AddLine_ili(const char* Text, const char FirstLine);

Gascounter_main.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,18 @@ void init(void)
639639
}
640640
else
641641
{
642-
642+
#ifdef ili9341
643+
Print_add_Line(STR_INIT_PRESS_ERR,2);
644+
#endif
645+
#ifdef GCM_old_disp
646+
Print_add_Line(STR_INIT_PRESS_ERR,0);
647+
#endif
643648
connected.BMP = 0;
644649
connected.BMP_on_Startup = 0;
645650
connected.TWI = 1;
646651
BMP_Temperature = 0;
647652
BMP_Pressure = 0;
648-
Print_add_Line(" ",0);
653+
//Print_add_Line(" ",0);
649654

650655
}
651656

@@ -1249,7 +1254,7 @@ void execute_server_CMDS(uint8_t reply_id){
12491254

12501255
case GET_SC_XBEE_MASK:
12511256
;
1252-
1257+
12531258
sendbuffer[0] = xbee.ScanChannels >> 8;
12541259
sendbuffer[1] = xbee.ScanChannels;
12551260

@@ -1284,7 +1289,7 @@ void execute_server_CMDS(uint8_t reply_id){
12841289
xbee.CoordIdentifier[NI_len] = '\0';
12851290

12861291
xbee_pseudo_send_AT_response( 'N', 'I', 0, sendbuffer, 0);
1287-
1292+
break;
12881293
default:;
12891294
uint8_t AT_Code = frameBuffer[reply_id].type;
12901295

@@ -1721,7 +1726,7 @@ int main(void)
17211726
while(1)
17221727
{
17231728
delta_t = count_t_elapsed - time_first_try;
1724-
if(delta_t > 60)
1729+
if(delta_t > WAITTIME_COORDINATOR_ACTIVATION)
17251730
{
17261731
Print_add_Line("...failed!",0);
17271732
Print_add_Line("offline mode",0);
@@ -2077,8 +2082,8 @@ int main(void)
20772082

20782083

20792084
if((delta.t_send >= options.t_transmission_max * 60)|| //
2080-
(delta.t_send >= options.t_transmission_min && delta.Volume_since_last_send > options.delta_V)||
2081-
(delta.t_send >= options.t_transmission_min && delta.Pressure_since_last_send > options.delta_p)||
2085+
(delta.t_send >= options.t_transmission_min && delta.Volume_since_last_send >= options.delta_V)||
2086+
(delta.t_send >= options.t_transmission_min && delta.Pressure_since_last_send >= options.delta_p)||
20822087
(delta.t_send >= options.t_transmission_min && status_reset_on_send && status_reset_on_send != last.Status_on_Send) )
20832088
{
20842089

Gascounter_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define MEASUREMENT_MESSAGE_LENGTH 23 /**< @brief Number of Bytes that makes up one Measurement Message*/
3737
#define NUMBER_LOGIN_BYTES 36 /**< @brief Number of Bytes in login Message from Server */
3838

39+
#define WAITTIME_COORDINATOR_ACTIVATION 300
3940
//#define COM_TIMEOUT_TIME 10 /**< @brief Communication Timeout-period in Seconds */
4041

4142

StringPixelCoordTable_ili9341.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@
112112
#define STR_INIT_CLOCK_ERR "Init DS3231M RTC ...error"
113113
#define STR_INIT_PRESS "Init BMP085"
114114
#define STR_INIT_PRESS_SUCC "Init BMP085 ...success"
115+
#define STR_INIT_PRESS_ERR "Init BMP085 not connected"
115116
#define STR_INIT_DONE "Init done"
116117

117118

118119

119120
// Strings
120121

121-
#define STR_INIT_OFFLINE "Init Offline"
122+
#define STR_INIT_OFFLINE "Network Err"
122123
#define STR_INIT_OFFLINE_MESSAGE "Network connection \ncould not be establishedon startup\n\nNetworkstatus:\n%s"
123124
#define STR_NO_COORDINATOR_FOUND "No Coordinator found"
124125
#define STR_NO_SERVER_FOUND "No Server found"

0 commit comments

Comments
 (0)