4848#include "StringPixelCoordTabble_old.h"
4949#endif
5050
51+ #ifdef ili9341
52+ #include "StringPixelCoordTable_ili9341.h"
53+ #endif
54+
5155#include "I2C_utilities.h"
5256#include "module_globals.h"
5357#include "adwandler.h"
@@ -531,11 +535,11 @@ void init(void)
531535
532536 #ifdef ili9341
533537 setInitScreen (black ,white ,6 ,1 ,1 ,1 );
534- Print_add_Line ("HZB Gascount" ,0 );
538+ Print_add_Line (STR_HZB_GASCOUNTER ,0 );
535539 #endif
536540
537541 #ifdef GCM_old_disp
538- Print_add_Line ("HZB Gascount" ,1 );
542+ Print_add_Line (STR_HZB_GASCOUNTER ,1 );
539543 #endif
540544
541545
@@ -544,34 +548,34 @@ void init(void)
544548 sprintf (print_temp ,"v%i.%i" ,version .Branch_id ,version .Fw_version );
545549 Print_add_Line (print_temp ,0 );
546550 #ifdef USE_LAN
547- Print_add_Line ("LAN-VARIANT" ,0 );
551+ Print_add_Line (STR_LAN_VARIANT ,0 );
548552 #endif
549553 #ifdef USE_XBEE
550- Print_add_Line ("XBEE-VARIANT" ,0 );
554+ Print_add_Line (STR_XBEE_VARIANT ,0 );
551555 #endif
552556
553557
554558
555559
556560 #ifdef ili9341
557- Print_add_Line ("Init start" ,0 );
561+ Print_add_Line (STR_INIT_START ,0 );
558562 #endif
559563
560564 #ifdef GCM_old_disp
561565 _delay_ms (2000 ); // the delay is for the xbee to start when the system is plugged in
562- Print_add_Line ("Init start" ,1 );
566+ Print_add_Line (STR_INIT_START ,1 );
563567 #endif
564568
565569
566- Print_add_Line ("Init ports" ,2 );
570+ Print_add_Line (STR_INIT_PORTS ,2 );
567571
568- Print_add_Line ("Init timer" ,2 );
572+ Print_add_Line (STR_INIT_TIMER ,2 );
569573 init_timer ();
570- Print_add_Line ("Init interr." ,2 );
574+ Print_add_Line (STR_INIT_INTERRUPTS ,2 );
571575 init_interrupts ();
572- Print_add_Line ("Init usart" ,2 );
576+ Print_add_Line (STR_INIT_USART ,2 );
573577 usart_init (39 );
574- Print_add_Line ("Init I2C" ,2 );
578+ Print_add_Line (STR_INIT_I2C ,2 );
575579 i2c_init ();
576580
577581
@@ -590,16 +594,16 @@ void init(void)
590594
591595
592596 // Timer
593- Print_add_Line ("Init Clock" ,2 );
597+ Print_add_Line (STR_INIT_CLOCK ,2 );
594598
595599 if (init_DS3231M (& paint_info_line ) == 0 ) // trying to connect with DS3231M (time)
596600 {
597601 connected .DS3231M = 1 ;
598602 #ifdef ili9341
599- Print_add_Line ("Init Clock ...success" ,2 );
603+ Print_add_Line (STR_INIT_CLOCK_SUCC ,2 );
600604 #endif
601605 #ifdef GCM_old_disp
602- Print_add_Line ("...success" ,0 );
606+ Print_add_Line (STR_INIT_CLOCK_SUCC ,0 );
603607 #endif
604608
605609 }
@@ -608,25 +612,25 @@ void init(void)
608612 connected .DS3231M = 0 ;
609613 SET_ERROR (TIMER_ERROR );
610614 #ifdef ili9341
611- Print_add_Line ("Init Clock ...error" ,2 );
615+ Print_add_Line (STR_INIT_CLOCK_ERR ,2 );
612616 #endif
613617 #ifdef GCM_old_disp
614- Print_add_Line ("...error" ,0 );
618+ Print_add_Line (STR_INIT_CLOCK_ERR ,0 );
615619 #endif
616620 }
617621
618622 // Pressure and Temperature Sensor
619- Print_add_Line ("Init Press" ,0 );
623+ Print_add_Line (STR_INIT_PRESS ,0 );
620624
621625 if (init_BMP (& paint_info_line ) == 0 ) // trying to connect with BMP
622626 {
623627 connected .BMP = 1 ;
624628 connected .BMP_on_Startup = 1 ;
625629 #ifdef ili9341
626- Print_add_Line ("Init Press ...success" ,2 );
630+ Print_add_Line (STR_INIT_PRESS_SUCC ,2 );
627631 #endif
628632 #ifdef GCM_old_disp
629- Print_add_Line ("...success" ,0 );
633+ Print_add_Line (STR_INIT_PRESS_SUCC ,0 );
630634 #endif
631635 CLEAR_ERROR (TEMPPRESS_ERROR );;
632636 }
@@ -646,7 +650,7 @@ void init(void)
646650 xbee_init (& paint_info_line ,NULL ,0 );
647651
648652 xbee_hardware_version ();
649- Print_add_Line ("Init done" ,0 );
653+ Print_add_Line (STR_INIT_DONE ,0 );
650654
651655
652656
@@ -1233,6 +1237,25 @@ void execute_server_CMDS(uint8_t reply_id){
12331237
12341238 xbee_pseudo_send_AT_response ( 'N' , 'I' , 0 , sendbuffer , 0 );
12351239
1240+ default :;
1241+ uint8_t AT_Code = frameBuffer [reply_id ].type ;
1242+
1243+
1244+ // handle unknown AT command
1245+ if (AT_Code >= 200 )
1246+ {
1247+
1248+
1249+ xbee_pseudo_send_AT_response (
1250+ AT_Lut [(uint8_t )(AT_Code - AT_START )][0 ], // translate AT_code back to At ASCII chars
1251+ AT_Lut [(uint8_t )(AT_Code - AT_START )][1 ],
1252+ 1 , // Status == 1 --> atcommand not known
1253+ sendbuffer ,
1254+ 0 ); // empty payload
1255+ }
1256+
1257+ break ;
1258+
12361259 #endif
12371260
12381261 }
@@ -1392,9 +1415,7 @@ void Set_Options(uint8_t *optBuffer,uint8_t answer_code){
13921415 .delta_V = (((uint32_t ) optBuffer [22 ] << 8 ) | optBuffer [23 ])* 1000 ,
13931416 .delta_p = ((uint16_t ) optBuffer [24 ] << 8 ) | optBuffer [25 ],
13941417 .step_Volume = (((uint32_t ) optBuffer [26 ] << 8 ) | optBuffer [27 ])* 1000 ,
1395- //.offset_pressure = ((int16_t) optBuffer[28] << 8) | optBuffer[29], // the value is transmitted with +32768 because no negative numbers can be transmitted
1396- //.span_pressure = ((uint16_t) optBuffer[30] << 8) | optBuffer[31],
1397- .T_Compensation_enable = optBuffer [28 ], //TODO Decrease bytenum by 4...
1418+ .T_Compensation_enable = optBuffer [28 ],
13981419 .Temperature_norm = ((uint16_t ) optBuffer [29 ] << 8 ) | optBuffer [30 ] ,
13991420 .p_Compensation_enable = optBuffer [31 ] ,
14001421 .Pressure_norm = ((uint16_t ) optBuffer [32 ] << 8 ) | optBuffer [33 ],
0 commit comments