comparison Small_CPU/Src/uart.c @ 1065:1f2067cad41b Icon_Integration

Mixed sensor operation improvment: A peak detector has been added to the adc measurement to avoid interferance while UART sensor are taking measurement while adc is active. The previous approach to shift adc into time windows where no UART were active had to be replaced because for the CO2 sensor is continously taking samples without providing a sync signal. In addition the UART MUX switching behavior has been improved (potential rx data received from previous sensor is discarded during channel switch etc.)
author Ideenmodellierer
date Mon, 16 Feb 2026 21:27:26 +0100
parents c386ae6635e4
children
comparison
equal deleted inserted replaced
1064:449e0f8f23d0 1065:1f2067cad41b
438 do 438 do
439 { 439 {
440 while((!UART_isEndIndication(pUartCtrl, localRX)) || (moreData)) 440 while((!UART_isEndIndication(pUartCtrl, localRX)) || (moreData))
441 { 441 {
442 moreData = 0; 442 moreData = 0;
443 switch (sensorType) 443 if(flush == 0)
444 { 444 {
445 case SENSOR_MUX: 445 switch (sensorType)
446 case SENSOR_DIGO2: uartO2_ProcessData(pUartCtrl->pRxBuffer[localRX]); 446 {
447 break; 447 case SENSOR_MUX:
448 #ifdef ENABLE_CO2_SUPPORT 448 case SENSOR_DIGO2: uartO2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
449 case SENSOR_CO2: uartCo2_ProcessData(pUartCtrl->pRxBuffer[localRX]); 449 break;
450 break; 450 #ifdef ENABLE_CO2_SUPPORT
451 #endif 451 case SENSOR_CO2: uartCo2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
452 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN 452 break;
453 case SENSOR_GNSS: uartGnss_ProcessData(pUartCtrl->pRxBuffer[localRX]); 453 #endif
454 break; 454 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
455 #endif 455 case SENSOR_GNSS: uartGnss_ProcessData(pUartCtrl->pRxBuffer[localRX]);
456 #ifdef ENABLE_SENTINEL_MODE 456 break;
457 case SENSOR_SENTINEL: uartSentinel_ProcessData(pUartCtrl->pRxBuffer[localRX]); 457 #endif
458 break; 458 #ifdef ENABLE_SENTINEL_MODE
459 #endif 459 case SENSOR_SENTINEL: uartSentinel_ProcessData(pUartCtrl->pRxBuffer[localRX]);
460 default: 460 break;
461 break; 461 #endif
462 default:
463 break;
464 }
462 } 465 }
463 if(localRX % 2) 466 if(localRX % 2)
464 { 467 {
465 pUartCtrl->pRxBuffer[localRX] = BUFFER_NODATA_HIGH; 468 pUartCtrl->pRxBuffer[localRX] = BUFFER_NODATA_HIGH;
466 } 469 }