Mercurial > public > ostc4
comparison Small_CPU/Src/externalInterface.c @ 1077:bd8ab302ef4a Icon_Integration
Added uart support for HUD:
the protocol implementation for the HUD has been added. It may be activated by the compile switch ENABLE_HUD_SUPPORT. Because the HUD will not mapped to the three classic o2 value display slots, the sensor data structure has been increased to the max number of devices => all devices may now raise device specific data.
| author | Ideenmodellierer |
|---|---|
| date | Mon, 02 Mar 2026 17:22:25 +0100 |
| parents | 8b97003dbb60 |
| children |
comparison
equal
deleted
inserted
replaced
| 1076:c87753e73eb8 | 1077:bd8ab302ef4a |
|---|---|
| 34 #include "pressure.h" | 34 #include "pressure.h" |
| 35 #include "uartProtocol_O2.h" | 35 #include "uartProtocol_O2.h" |
| 36 #include "uartProtocol_Co2.h" | 36 #include "uartProtocol_Co2.h" |
| 37 #include "uartProtocol_Sentinel.h" | 37 #include "uartProtocol_Sentinel.h" |
| 38 #include "uartProtocol_GNSS.h" | 38 #include "uartProtocol_GNSS.h" |
| 39 #include "uartProtocol_HUD.h" | |
| 39 | 40 |
| 40 extern SGlobal global; | 41 extern SGlobal global; |
| 41 extern UART_HandleTypeDef huart1; | 42 extern UART_HandleTypeDef huart1; |
| 42 extern sUartComCtrl Uart1Ctrl; | 43 extern sUartComCtrl Uart1Ctrl; |
| 43 | 44 |
| 83 static uint16_t externalCO2SignalStrength; | 84 static uint16_t externalCO2SignalStrength; |
| 84 static uint16_t externalCO2Status = 0; | 85 static uint16_t externalCO2Status = 0; |
| 85 static float externalCO2Scale = 0.0; | 86 static float externalCO2Scale = 0.0; |
| 86 | 87 |
| 87 static uint8_t externalBottleBar[PRESSURE_BOTTLE_CNT] = {0,0}; | 88 static uint8_t externalBottleBar[PRESSURE_BOTTLE_CNT] = {0,0}; |
| 89 static uint8_t externalHUDBrightness = 0; | |
| 90 static uint8_t externalHUDSequence[EXT_INTERFACE_HUD_LED_MAX]; | |
| 91 | |
| 88 | 92 |
| 89 static uint8_t lastSensorDataId = 0; | 93 static uint8_t lastSensorDataId = 0; |
| 90 static SSensorDataDiveO2 sensorDataDiveO2[EXT_INTERFACE_SENSOR_CNT]; | 94 static uint8_t sensorData[EXT_INTERFACE_SENSOR_CNT][EXTIF_SENSOR_INFO_SIZE]; |
| 91 static externalInterfaceAutoDetect_t externalAutoDetect = DETECTION_OFF; | 95 static externalInterfaceAutoDetect_t externalAutoDetect = DETECTION_OFF; |
| 92 static externalInterfaceSensorType SensorMap[EXT_INTERFACE_SENSOR_CNT] ={ SENSOR_OPTIC, SENSOR_OPTIC, SENSOR_OPTIC, SENSOR_NONE, SENSOR_NONE}; | 96 static externalInterfaceSensorType SensorMap[EXT_INTERFACE_SENSOR_CNT] ={ SENSOR_OPTIC, SENSOR_OPTIC, SENSOR_OPTIC, SENSOR_NONE, SENSOR_NONE}; |
| 93 static externalInterfaceSensorType tmpSensorMap[EXT_INTERFACE_SENSOR_CNT]; | 97 static externalInterfaceSensorType tmpSensorMap[EXT_INTERFACE_SENSOR_CNT]; |
| 94 static externalInterfaceSensorType MasterSensorMap[EXT_INTERFACE_SENSOR_CNT]; | 98 static externalInterfaceSensorType MasterSensorMap[EXT_INTERFACE_SENSOR_CNT]; |
| 95 static externalInterfaceSensorType foundSensorMap[EXT_INTERFACE_SENSOR_CNT]; | 99 static externalInterfaceSensorType foundSensorMap[EXT_INTERFACE_SENSOR_CNT]; |
| 397 } | 401 } |
| 398 } | 402 } |
| 399 | 403 |
| 400 void externalInterface_SwitchUART(uint8_t protocol) | 404 void externalInterface_SwitchUART(uint8_t protocol) |
| 401 { | 405 { |
| 402 switch(protocol) | 406 lastSensorDataId = 0; |
| 403 { | 407 externalUART_Protocol = protocol; |
| 404 case EXT_INTERFACE_UART_OFF: | 408 MX_USART1_UART_DeInit(); |
| 405 case EXT_INTERFACE_UART_CO2: | 409 if( protocol != EXT_INTERFACE_UART_OFF) |
| 406 case EXT_INTERFACE_UART_O2: | 410 { |
| 407 case EXT_INTERFACE_UART_SENTINEL: | 411 MX_USART1_UART_Init(); |
| 408 case EXT_INTERFACE_UART_GNSS: | |
| 409 if((externalAutoDetect <= DETECTION_START) | |
| 410 || ((protocol == EXT_INTERFACE_UART_O2) && (externalAutoDetect >= DETECTION_UARTMUX) && (externalAutoDetect <= DETECTION_DIGO2_3)) | |
| 411 | |
| 412 #ifdef ENABLE_CO2_SUPPORT | |
| 413 || ((externalAutoDetect >= DETECTION_CO2_0) && (externalAutoDetect <= DETECTION_CO2_3)) | |
| 414 #endif | |
| 415 #ifdef ENABLE_GNSS_EXTERN | |
| 416 || ((externalAutoDetect >= DETECTION_GNSS_0) && (externalAutoDetect <= DETECTION_GNSS_3)) | |
| 417 #endif | |
| 418 | |
| 419 #ifdef ENABLE_SENTINEL_MODE | |
| 420 || ((protocol == EXT_INTERFACE_UART_SENTINEL) && (externalAutoDetect == DETECTION_SENTINEL)) | |
| 421 #endif | |
| 422 ) | |
| 423 { | |
| 424 lastSensorDataId = 0; | |
| 425 externalUART_Protocol = protocol; | |
| 426 MX_USART1_UART_DeInit(); | |
| 427 if( protocol != 0) | |
| 428 { | |
| 429 MX_USART1_UART_Init(); | |
| 430 } | |
| 431 } | |
| 432 break; | |
| 433 default: | |
| 434 break; | |
| 435 } | 412 } |
| 436 } | 413 } |
| 437 | 414 |
| 438 uint8_t externalInterface_GetActiveUartSensor() | 415 uint8_t externalInterface_GetActiveUartSensor() |
| 439 { | 416 { |
| 507 uint16_t externalInterface_GetCO2SignalStrength(void) | 484 uint16_t externalInterface_GetCO2SignalStrength(void) |
| 508 { | 485 { |
| 509 return externalCO2SignalStrength; | 486 return externalCO2SignalStrength; |
| 510 } | 487 } |
| 511 | 488 |
| 489 | |
| 490 void externalInterface_GetHUDSequence(uint8_t* pSequence, uint8_t* brightness) | |
| 491 { | |
| 492 memcpy(pSequence, externalHUDSequence, EXT_INTERFACE_HUD_LED_MAX); | |
| 493 *brightness = externalHUDBrightness; | |
| 494 } | |
| 495 | |
| 496 void externalInterface_SetHUDSequence(uint8_t* pSequence, uint8_t brightness) | |
| 497 { | |
| 498 memcpy(externalHUDSequence, pSequence, EXT_INTERFACE_HUD_LED_MAX); | |
| 499 externalHUDBrightness = brightness; | |
| 500 } | |
| 501 | |
| 502 uint8_t externalInterface_GetBottlePressure(uint8_t bottle) | |
| 503 { | |
| 504 uint8_t ret = 0; | |
| 505 | |
| 506 if(bottle < PRESSURE_BOTTLE_CNT) | |
| 507 { | |
| 508 ret = externalBottleBar[bottle]; | |
| 509 } | |
| 510 return ret; | |
| 511 } | |
| 512 | |
| 512 void externalInterface_SetBottlePressure(uint8_t bottle, uint8_t bar) | 513 void externalInterface_SetBottlePressure(uint8_t bottle, uint8_t bar) |
| 513 { | 514 { |
| 514 if(bottle < PRESSURE_BOTTLE_CNT) | 515 if(bottle < PRESSURE_BOTTLE_CNT) |
| 515 { | 516 { |
| 516 externalBottleBar[bottle] = bar; | 517 externalBottleBar[bottle] = bar; |
| 517 } | 518 } |
| 518 } | 519 } |
| 519 | 520 |
| 520 uint8_t externalInterface_GetBottlePressure(uint8_t bottle) | 521 void externalInterface_CopySensorData(uint8_t sensorId, uint8_t* target, uint8_t* source) |
| 521 { | 522 { |
| 522 uint8_t ret = 0; | 523 if(sensorId < EXT_INTERFACE_SENSOR_CNT) |
| 523 | 524 { |
| 524 if(bottle < PRESSURE_BOTTLE_CNT) | 525 switch(SensorMap[sensorId]) |
| 525 { | 526 { |
| 526 ret = externalBottleBar[bottle]; | 527 case SENSOR_DIGO2M: |
| 527 } | 528 case SENSOR_DIGO2: memcpy(target, source, sizeof(SSensorDataDiveO2)); |
| 528 return ret; | 529 break; |
| 529 } | 530 case SENSOR_HUD: memcpy(target, source, HUD_INFO_DATA_LENGTH); |
| 530 | 531 break; |
| 532 default: | |
| 533 break; | |
| 534 } | |
| 535 } | |
| 536 } | |
| 531 | 537 |
| 532 uint8_t externalInterface_GetSensorData(uint8_t sensorId, uint8_t* pDataStruct) | 538 uint8_t externalInterface_GetSensorData(uint8_t sensorId, uint8_t* pDataStruct) |
| 533 { | 539 { |
| 534 uint8_t index = 0; | 540 uint8_t index = 0; |
| 535 uint8_t localId = sensorId; | 541 uint8_t localId = sensorId; |
| 538 localId = lastSensorDataId; | 544 localId = lastSensorDataId; |
| 539 } | 545 } |
| 540 | 546 |
| 541 if((pDataStruct != NULL) && (localId <= EXT_INTERFACE_SENSOR_CNT)) | 547 if((pDataStruct != NULL) && (localId <= EXT_INTERFACE_SENSOR_CNT)) |
| 542 { | 548 { |
| 543 memcpy(pDataStruct, &sensorDataDiveO2[localId], sizeof(SSensorDataDiveO2)); | 549 externalInterface_CopySensorData(localId, pDataStruct, &sensorData[localId][0]); |
| 544 } | 550 } |
| 545 else | 551 else |
| 546 { | 552 { |
| 547 localId = 0xFF; | 553 localId = 0xFF; |
| 548 } | 554 } |
| 566 | 572 |
| 567 if(pDataStruct != NULL) | 573 if(pDataStruct != NULL) |
| 568 { | 574 { |
| 569 if((sensorId != 0xFF) && (sensorId < EXT_INTERFACE_SENSOR_CNT)) | 575 if((sensorId != 0xFF) && (sensorId < EXT_INTERFACE_SENSOR_CNT)) |
| 570 { | 576 { |
| 571 memcpy(&sensorDataDiveO2[sensorId], pDataStruct, sizeof(SSensorDataDiveO2)); | 577 externalInterface_CopySensorData(sensorId, &sensorData[sensorId][0], pDataStruct); |
| 572 lastSensorDataId = sensorId; | 578 lastSensorDataId = sensorId; |
| 573 if(sensorId >= MAX_ADC_CHANNEL) | 579 if(sensorId >= MAX_ADC_CHANNEL) |
| 574 { | 580 { |
| 575 for(index = 0; index < MAX_ADC_CHANNEL; index++) | 581 for(index = 0; index < MAX_ADC_CHANNEL; index++) |
| 576 { | 582 { |
| 577 if(Mux2ADCMap[index] == sensorId) | 583 if(Mux2ADCMap[index] == sensorId) |
| 578 { | 584 { |
| 579 memcpy(&sensorDataDiveO2[index], pDataStruct, sizeof(SSensorDataDiveO2)); | 585 externalInterface_CopySensorData(index, &sensorData[index][0], pDataStruct); |
| 580 lastSensorDataId = index; | 586 lastSensorDataId = index; |
| 581 break; | 587 break; |
| 582 } | 588 } |
| 583 } | 589 } |
| 584 } | 590 } |
| 585 } | 591 } |
| 586 else | 592 else |
| 587 { | 593 { |
| 588 memset(&sensorDataDiveO2,0,sizeof(sensorDataDiveO2)); | 594 memset(&sensorData,0,EXTIF_SENSOR_INFO_SIZE * EXT_INTERFACE_SENSOR_CNT); |
| 589 lastSensorDataId = 0xFF; | 595 lastSensorDataId = 0xFF; |
| 590 } | 596 } |
| 591 } | 597 } |
| 592 } | 598 } |
| 593 | 599 |
| 856 } | 862 } |
| 857 else | 863 else |
| 858 { | 864 { |
| 859 | 865 |
| 860 | 866 |
| 861 #if defined ENABLE_SENTINEL_MODE || defined ENABLE_GNSS_EXTERN | 867 #if defined ENABLE_SENTINEL_MODE || defined ENABLE_GNSS_EXTERN || defined ENABLE_HUD_SUPPORT |
| 862 #ifdef ENABLE_GNSS_EXTERN | 868 #ifdef ENABLE_GNSS_EXTERN |
| 863 externalAutoDetect = DETECTION_GNSS_0; | 869 externalAutoDetect = DETECTION_GNSS_0; |
| 864 externalInterface_SwitchUART(EXT_INTERFACE_UART_GNSS); | 870 externalInterface_SwitchUART(EXT_INTERFACE_UART_GNSS); |
| 865 #else | 871 #else |
| 866 #ifdef ENABLE_SENTINEL_MODE | 872 #ifdef ENABLE_SENTINEL_MODE |
| 867 externalAutoDetect = DETECTION_SENTINEL; | 873 externalAutoDetect = DETECTION_SENTINEL; |
| 874 #else | |
| 875 #ifdef ENABLE_HUD_SUPPORT | |
| 876 externalAutoDetect = DETECTION_HUD_0; | |
| 877 #endif | |
| 868 #endif | 878 #endif |
| 869 #endif | 879 #endif |
| 870 #else | 880 #else |
| 871 externalAutoDetect = DETECTION_DONE; | 881 externalAutoDetect = DETECTION_DONE; |
| 872 #endif | 882 #endif |
| 956 foundSensorMap[index] = SENSOR_SENTINEL; | 966 foundSensorMap[index] = SENSOR_SENTINEL; |
| 957 } | 967 } |
| 958 } | 968 } |
| 959 externalAutoDetect++; | 969 externalAutoDetect++; |
| 960 #endif | 970 #endif |
| 971 | |
| 972 #ifdef ENABLE_HUD_SUPPORT | |
| 973 if(externalAutoDetect == DETECTION_HUD_0) | |
| 974 { | |
| 975 tmpSensorMap[uartMuxChannel + EXT_INTERFACE_MUX_OFFSET] = SENSOR_NONE; | |
| 976 if(foundSensorMap[EXT_INTERFACE_SENSOR_CNT-1] == SENSOR_MUX) | |
| 977 { | |
| 978 externalInterface_CheckBaudrate(SENSOR_DIGO2); | |
| 979 UART_MUX_SelectAddress(0); | |
| 980 } | |
| 981 activeUartChannel = 0; | |
| 982 tmpSensorMap[uartMuxChannel - 1 + EXT_INTERFACE_MUX_OFFSET] = SENSOR_NONE; | |
| 983 uartMuxChannel = 1; | |
| 984 tmpSensorMap[EXT_INTERFACE_MUX_OFFSET] = SENSOR_HUD; | |
| 985 externalInterface_SensorState[EXT_INTERFACE_MUX_OFFSET] = UART_COMMON_INIT; | |
| 986 externalInterface_CheckBaudrate(SENSOR_HUD); | |
| 987 externalInterfaceMuxReqIntervall = 500; /* iterations needed for module config */ | |
| 988 } | |
| 989 break; | |
| 990 case DETECTION_HUD_0: | |
| 991 case DETECTION_HUD_1: | |
| 992 case DETECTION_HUD_2: | |
| 993 case DETECTION_HUD_3: | |
| 994 if(uartHUD_isSensorConnected()) | |
| 995 { | |
| 996 foundSensorMap[EXT_INTERFACE_MUX_OFFSET + activeUartChannel] = SENSOR_HUD; | |
| 997 externalAutoDetect = DETECTION_DONE; /* only one HUD sensor supported */ | |
| 998 } | |
| 999 else if(foundSensorMap[EXT_INTERFACE_SENSOR_CNT-1] == SENSOR_MUX) | |
| 1000 { | |
| 1001 externalInterface_CheckBaudrate(SENSOR_DIGO2); | |
| 1002 UART_MUX_SelectAddress(uartMuxChannel); | |
| 1003 activeUartChannel = uartMuxChannel; | |
| 1004 tmpSensorMap[uartMuxChannel - 1 + EXT_INTERFACE_MUX_OFFSET] = SENSOR_NONE; | |
| 1005 tmpSensorMap[EXT_INTERFACE_MUX_OFFSET + uartMuxChannel] = SENSOR_CO2; | |
| 1006 externalInterface_SensorState[EXT_INTERFACE_MUX_OFFSET + uartMuxChannel] = UART_COMMON_INIT; | |
| 1007 externalInterface_CheckBaudrate(SENSOR_HUD); | |
| 1008 externalAutoDetect++; | |
| 1009 uartMuxChannel++; | |
| 1010 } | |
| 1011 else | |
| 1012 { | |
| 1013 externalAutoDetect = DETECTION_DONE; | |
| 1014 } | |
| 1015 #endif | |
| 961 break; | 1016 break; |
| 962 case DETECTION_DONE: externalAutoDetect = DETECTION_OFF; | 1017 case DETECTION_DONE: externalAutoDetect = DETECTION_OFF; |
| 963 externalInterface_SwitchUART(EXT_INTERFACE_UART_OFF); | 1018 externalInterface_SwitchUART(EXT_INTERFACE_UART_OFF); |
| 964 activeUartChannel = 0xFF; | 1019 activeUartChannel = 0xFF; |
| 965 cntSensor = 0; | 1020 cntSensor = 0; |
| 969 if((foundSensorMap[index] >= SENSOR_ANALOG) && (foundSensorMap[index] < SENSOR_MUX)) | 1024 if((foundSensorMap[index] >= SENSOR_ANALOG) && (foundSensorMap[index] < SENSOR_MUX)) |
| 970 { | 1025 { |
| 971 cntSensor++; | 1026 cntSensor++; |
| 972 } | 1027 } |
| 973 | 1028 |
| 974 if((foundSensorMap[index] == SENSOR_DIGO2) || (foundSensorMap[index] == SENSOR_CO2) || (foundSensorMap[index] == SENSOR_GNSS)) | 1029 if((foundSensorMap[index] == SENSOR_DIGO2) || (foundSensorMap[index] == SENSOR_CO2) || (foundSensorMap[index] == SENSOR_GNSS) || (foundSensorMap[index] == SENSOR_HUD)) |
| 975 { | 1030 { |
| 976 cntUARTSensor++; | 1031 cntUARTSensor++; |
| 977 } | 1032 } |
| 978 #ifdef ENABLE_SENTINEL_MODE | 1033 #ifdef ENABLE_SENTINEL_MODE |
| 979 if(foundSensorMap[index] == SENSOR_SENTINEL) /* The Sentinel has a fixed setup */ | 1034 if(foundSensorMap[index] == SENSOR_SENTINEL) /* The Sentinel has a fixed setup */ |
| 984 } | 1039 } |
| 985 #endif | 1040 #endif |
| 986 } | 1041 } |
| 987 externalInface_MapUartToLegacyADC(foundSensorMap); | 1042 externalInface_MapUartToLegacyADC(foundSensorMap); |
| 988 externalInterfaceMuxReqIntervall = 0xFFFF; | 1043 externalInterfaceMuxReqIntervall = 0xFFFF; |
| 989 if(cntSensor == 0) /* return default sensor map if no sensor at all has been detected */ | 1044 if((cntSensor == 0) /* return default sensor map if no sensor at all has been detected */ |
| 1045 || ((foundSensorMap[0] == SENSOR_NONE) && (foundSensorMap[1] == SENSOR_NONE) && (foundSensorMap[2] == SENSOR_NONE))) | |
| 990 { | 1046 { |
| 991 foundSensorMap[0] = SENSOR_OPTIC; | 1047 foundSensorMap[0] = SENSOR_OPTIC; |
| 992 foundSensorMap[1] = SENSOR_OPTIC; | 1048 foundSensorMap[1] = SENSOR_OPTIC; |
| 993 foundSensorMap[2] = SENSOR_OPTIC; | 1049 foundSensorMap[2] = SENSOR_OPTIC; |
| 994 } | 1050 } |
| 995 else | 1051 if(cntUARTSensor != 0) |
| 996 { | 1052 { |
| 997 if(cntUARTSensor != 0) | 1053 externalInterfaceMuxReqIntervall = REQUEST_INT_SENSOR_MS / cntUARTSensor; |
| 998 { | 1054 if(foundSensorMap[0] == SENSOR_SENTINELM) /* special case: Sentinel sends combined data */ |
| 999 externalInterfaceMuxReqIntervall = REQUEST_INT_SENSOR_MS / cntUARTSensor; | 1055 { |
| 1000 if(foundSensorMap[0] == SENSOR_SENTINELM) /* special case: Sentinel sends combined data */ | 1056 externalInterfaceMuxReqIntervall = 4000; |
| 1001 { | 1057 } |
| 1002 externalInterfaceMuxReqIntervall = 4000; | 1058 } |
| 1003 } | 1059 |
| 1004 } | |
| 1005 } | |
| 1006 memcpy(SensorMap, foundSensorMap, sizeof(foundSensorMap)); | 1060 memcpy(SensorMap, foundSensorMap, sizeof(foundSensorMap)); |
| 1007 memset(externalInterface_SensorState, UART_COMMON_INIT, sizeof(externalInterface_SensorState)); | 1061 memset(externalInterface_SensorState, UART_COMMON_INIT, sizeof(externalInterface_SensorState)); |
| 1008 break; | 1062 break; |
| 1009 default: | 1063 default: |
| 1010 break; | 1064 break; |
| 1073 if(SensorMap[index] == SENSOR_DIGO2) | 1127 if(SensorMap[index] == SENSOR_DIGO2) |
| 1074 { | 1128 { |
| 1075 externalInterface_SensorState[index] = UART_O2_CHECK; | 1129 externalInterface_SensorState[index] = UART_O2_CHECK; |
| 1076 } | 1130 } |
| 1077 break; | 1131 break; |
| 1078 | 1132 #ifdef ENABLE_HUD_SUPPORT |
| 1133 case EXT_INTERFACE_HUD_UPDATE: index = (Cmd >> 8) & 0x000F; | |
| 1134 if(SensorMap[index] == SENSOR_HUD) | |
| 1135 { | |
| 1136 externalInterface_SensorState[index] = UART_HUD_UPDATE; | |
| 1137 } | |
| 1138 break; | |
| 1139 case EXT_INTERFACE_HUD_ABORT: index = (Cmd >> 8) & 0x000F; | |
| 1140 if(SensorMap[index] == SENSOR_HUD) | |
| 1141 { | |
| 1142 externalInterface_SensorState[index] = UART_HUD_ABORT; | |
| 1143 } | |
| 1144 break; | |
| 1145 #endif | |
| 1079 default: | 1146 default: |
| 1080 break; | 1147 break; |
| 1081 } | 1148 } |
| 1082 if(cmdLength != 0) | 1149 if(cmdLength != 0) |
| 1083 { | 1150 { |
| 1099 { | 1166 { |
| 1100 index = 0; | 1167 index = 0; |
| 1101 } | 1168 } |
| 1102 if(((pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_DIGO2) | 1169 if(((pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_DIGO2) |
| 1103 || (pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_CO2) | 1170 || (pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_CO2) |
| 1104 || (pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_GNSS)) | 1171 || (pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_GNSS) |
| 1172 || (pmap[index + EXT_INTERFACE_MUX_OFFSET] == SENSOR_HUD)) | |
| 1105 && (index != activeUartChannel)) | 1173 && (index != activeUartChannel)) |
| 1106 { | 1174 { |
| 1107 newChannel = index; | 1175 newChannel = index; |
| 1108 break; | 1176 break; |
| 1109 } | 1177 } |
| 1120 { | 1188 { |
| 1121 case SENSOR_GNSS: | 1189 case SENSOR_GNSS: |
| 1122 case SENSOR_SENTINEL: | 1190 case SENSOR_SENTINEL: |
| 1123 case SENSOR_CO2: newBaudrate = 9600; | 1191 case SENSOR_CO2: newBaudrate = 9600; |
| 1124 break; | 1192 break; |
| 1193 case SENSOR_HUD: | |
| 1125 case SENSOR_DIGO2: | 1194 case SENSOR_DIGO2: |
| 1126 default: newBaudrate = 19200; | 1195 default: newBaudrate = 19200; |
| 1127 break; | 1196 break; |
| 1128 } | 1197 } |
| 1129 if(huart1.Init.BaudRate != newBaudrate) | 1198 if(huart1.Init.BaudRate != newBaudrate) |
| 1284 #endif | 1353 #endif |
| 1285 #ifdef ENABLE_SENTINEL_MODE | 1354 #ifdef ENABLE_SENTINEL_MODE |
| 1286 case SENSOR_SENTINEL: uartSentinel_Control(); | 1355 case SENSOR_SENTINEL: uartSentinel_Control(); |
| 1287 break; | 1356 break; |
| 1288 #endif | 1357 #endif |
| 1358 #ifdef ENABLE_HUD_SUPPORT | |
| 1359 case SENSOR_HUD: uartHUD_Control(); | |
| 1360 break; | |
| 1361 #endif | |
| 1289 default: | 1362 default: |
| 1290 break; | 1363 break; |
| 1291 } | 1364 } |
| 1292 } | 1365 } |
| 1293 } | 1366 } |
