Mercurial > public > ostc4
diff Small_CPU/Src/uartProtocol_Co2.c @ 932:effadaa3a1f7 Evo_2_23
Cleanup Gnss UART implementation:
The first draft of the internal UART implementation was just a copy of the external UART handling. To avoid duplicated code and maintainance issue both UARTs (external/internal 6/1) share the same functions. To enable this a control structure has to be used as function input which defines the none shared resources like DMA control and rx/tx buffers
| author | Ideenmodellierer |
|---|---|
| date | Sat, 07 Dec 2024 21:28:08 +0100 |
| parents | c0553dd70608 |
| children | 0b81ac558e89 |
line wrap: on
line diff
--- a/Small_CPU/Src/uartProtocol_Co2.c Tue Dec 03 20:32:51 2024 +0100 +++ b/Small_CPU/Src/uartProtocol_Co2.c Sat Dec 07 21:28:08 2024 +0100 @@ -24,7 +24,6 @@ #include "uart.h" #include "externalInterface.h" - #ifdef ENABLE_CO2_SUPPORT static uint8_t CO2Connected = 0; /* Binary indicator if a sensor is connected or not */ static receiveStateCO2_t rxState = CO2RX_Ready; @@ -84,8 +83,8 @@ { CO2Connected = 0; externalInterface_SetCO2Scale(0.0); - UART_clearRxBuffer(); - UART_StartDMA_Receiption(); + UART_clearRxBuffer(&Uart1Ctrl); + UART_StartDMA_Receiption(&Uart1Ctrl); localComState = UART_CO2_SETUP; } if(localComState == UART_CO2_SETUP) @@ -123,7 +122,7 @@ else { localComState = UART_CO2_OPERATING; /* sensor in streaming mode if not connected to mux => operating */ - UART_StartDMA_Receiption(); + UART_StartDMA_Receiption(&Uart1Ctrl); } } lastComState = localComState;
