Mercurial > public > ostc4
comparison Small_CPU/Src/externalInterface.c @ 988:d9290c76b840 GasConsumption
OSTC4/5 joined code:
In the previous version code differences between OSTC4/5 were identified using the ENABLE_GPIO_V2 compiler switch. In the new version this is done using the display version as indicator which OSTC model is in used. Since this is detected by Firmware the information is forwarded from there to the RTE. This causes a little delay in the GPIO initialization but this applies only to the cold start of the RTE which should not happen very often.
author | ideenmodellierer |
---|---|
date | Sun, 06 Apr 2025 21:02:17 +0200 (4 weeks ago) |
parents | 0b81ac558e89 |
children |
comparison
equal
deleted
inserted
replaced
984:41136649b90d | 988:d9290c76b840 |
---|---|
399 || ((protocol == EXT_INTERFACE_UART_O2) && (externalAutoDetect >= DETECTION_UARTMUX) && (externalAutoDetect <= DETECTION_DIGO2_3)) | 399 || ((protocol == EXT_INTERFACE_UART_O2) && (externalAutoDetect >= DETECTION_UARTMUX) && (externalAutoDetect <= DETECTION_DIGO2_3)) |
400 | 400 |
401 #ifdef ENABLE_CO2_SUPPORT | 401 #ifdef ENABLE_CO2_SUPPORT |
402 || ((externalAutoDetect >= DETECTION_CO2_0) && (externalAutoDetect <= DETECTION_CO2_3)) | 402 || ((externalAutoDetect >= DETECTION_CO2_0) && (externalAutoDetect <= DETECTION_CO2_3)) |
403 #endif | 403 #endif |
404 #ifdef ENABLE_GNSS_SUPPORT | 404 #ifdef ENABLE_GNSS_EXTERN |
405 || ((externalAutoDetect >= DETECTION_GNSS_0) && (externalAutoDetect <= DETECTION_GNSS_3)) | 405 || ((externalAutoDetect >= DETECTION_GNSS_0) && (externalAutoDetect <= DETECTION_GNSS_3)) |
406 #endif | 406 #endif |
407 | 407 |
408 #ifdef ENABLE_SENTINEL_MODE | 408 #ifdef ENABLE_SENTINEL_MODE |
409 || ((protocol == EXT_INTERFACE_UART_SENTINEL) && (externalAutoDetect == DETECTION_SENTINEL)) | 409 || ((protocol == EXT_INTERFACE_UART_SENTINEL) && (externalAutoDetect == DETECTION_SENTINEL)) |
670 | 670 |
671 void externalInterface_AutodetectSensor() | 671 void externalInterface_AutodetectSensor() |
672 { | 672 { |
673 static uint8_t sensorIndex = 0; | 673 static uint8_t sensorIndex = 0; |
674 static uint8_t uartMuxChannel = 0; | 674 static uint8_t uartMuxChannel = 0; |
675 #ifdef ENABLE_GNSS_SUPPORT | 675 #ifdef ENABLE_GNSS_EXTERN |
676 static uint8_t detectionDelayCnt = 0; | 676 static uint8_t detectionDelayCnt = 0; |
677 #endif | 677 #endif |
678 uint8_t index = 0; | 678 uint8_t index = 0; |
679 | 679 |
680 uint8_t cntSensor = 0; | 680 uint8_t cntSensor = 0; |
827 case DETECTION_CO2_1: | 827 case DETECTION_CO2_1: |
828 case DETECTION_CO2_2: | 828 case DETECTION_CO2_2: |
829 case DETECTION_CO2_3: if(uartCo2_isSensorConnected()) | 829 case DETECTION_CO2_3: if(uartCo2_isSensorConnected()) |
830 { | 830 { |
831 foundSensorMap[EXT_INTERFACE_MUX_OFFSET + activeUartChannel] = SENSOR_CO2; | 831 foundSensorMap[EXT_INTERFACE_MUX_OFFSET + activeUartChannel] = SENSOR_CO2; |
832 #ifdef ENABLE_GNSS_SUPPORT | 832 #ifdef ENABLE_GNSS_EXTERN |
833 externalAutoDetect = DETECTION_GNSS_0; /* only one CO2 sensor supported */ | 833 externalAutoDetect = DETECTION_GNSS_0; /* only one CO2 sensor supported */ |
834 #else | 834 #else |
835 externalAutoDetect = DETECTION_DONE; /* only one CO2 sensor supported */ | 835 externalAutoDetect = DETECTION_DONE; /* only one CO2 sensor supported */ |
836 #endif | 836 #endif |
837 } | 837 } |
850 } | 850 } |
851 else | 851 else |
852 { | 852 { |
853 | 853 |
854 | 854 |
855 #if defined ENABLE_SENTINEL_MODE || defined ENABLE_GNSS_SUPPORT | 855 #if defined ENABLE_SENTINEL_MODE || defined ENABLE_GNSS_EXTERN |
856 #ifdef ENABLE_GNSS_SUPPORT | 856 #ifdef ENABLE_GNSS_EXTERN |
857 externalAutoDetect = DETECTION_GNSS_0; | 857 externalAutoDetect = DETECTION_GNSS_0; |
858 externalInterface_SwitchUART(EXT_INTERFACE_UART_GNSS); | 858 externalInterface_SwitchUART(EXT_INTERFACE_UART_GNSS); |
859 #else | 859 #else |
860 #ifdef ENABLE_SENTINEL_MODE | 860 #ifdef ENABLE_SENTINEL_MODE |
861 externalAutoDetect = DETECTION_SENTINEL; | 861 externalAutoDetect = DETECTION_SENTINEL; |
865 externalAutoDetect = DETECTION_DONE; | 865 externalAutoDetect = DETECTION_DONE; |
866 #endif | 866 #endif |
867 } | 867 } |
868 #endif | 868 #endif |
869 | 869 |
870 #ifdef ENABLE_GNSS_SUPPORT | 870 #ifdef ENABLE_GNSS_EXTERN |
871 if(externalAutoDetect == DETECTION_GNSS_0) | 871 if(externalAutoDetect == DETECTION_GNSS_0) |
872 { | 872 { |
873 tmpSensorMap[uartMuxChannel + EXT_INTERFACE_MUX_OFFSET] = SENSOR_NONE; | 873 tmpSensorMap[uartMuxChannel + EXT_INTERFACE_MUX_OFFSET] = SENSOR_NONE; |
874 if(foundSensorMap[EXT_INTERFACE_SENSOR_CNT-1] == SENSOR_MUX) | 874 if(foundSensorMap[EXT_INTERFACE_SENSOR_CNT-1] == SENSOR_MUX) |
875 { | 875 { |
1249 break; | 1249 break; |
1250 #ifdef ENABLE_CO2_SUPPORT | 1250 #ifdef ENABLE_CO2_SUPPORT |
1251 case SENSOR_CO2: uartCo2_Control(); | 1251 case SENSOR_CO2: uartCo2_Control(); |
1252 break; | 1252 break; |
1253 #endif | 1253 #endif |
1254 #ifdef ENABLE_GNSS_SUPPORT | 1254 #ifdef ENABLE_GNSS_EXTERN |
1255 case SENSOR_GNSS: uartGnss_Control(); | 1255 case SENSOR_GNSS: uartGnss_Control(); |
1256 break; | 1256 break; |
1257 #endif | 1257 #endif |
1258 #ifdef ENABLE_SENTINEL_MODE | 1258 #ifdef ENABLE_SENTINEL_MODE |
1259 case SENSOR_SENTINEL: uartSentinel_Control(); | 1259 case SENSOR_SENTINEL: uartSentinel_Control(); |