comparison Small_CPU/Src/uartProtocol_Sentinel.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 3e499569baf3
children 785772303f9c
comparison
equal deleted inserted replaced
931:5a9bc2e6112d 932:effadaa3a1f7
26 26
27 27
28 #ifdef ENABLE_SENTINEL_MODE 28 #ifdef ENABLE_SENTINEL_MODE
29 static uint8_t SentinelConnected = 0; /* Binary indicator if a sensor is connected or not */ 29 static uint8_t SentinelConnected = 0; /* Binary indicator if a sensor is connected or not */
30 static receiveStateSentinel_t rxState = SENTRX_Ready; 30 static receiveStateSentinel_t rxState = SENTRX_Ready;
31
32 extern sUartComCtrl Uart1Ctrl;
31 33
32 void ConvertByteToHexString(uint8_t byte, char* str) 34 void ConvertByteToHexString(uint8_t byte, char* str)
33 { 35 {
34 uint8_t worker = 0; 36 uint8_t worker = 0;
35 uint8_t digit = 0; 37 uint8_t digit = 0;
58 uartSentinelStatus_t localComState = externalInterface_GetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET); 60 uartSentinelStatus_t localComState = externalInterface_GetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET);
59 61
60 if(localComState == UART_SENTINEL_INIT) 62 if(localComState == UART_SENTINEL_INIT)
61 { 63 {
62 SentinelConnected = 0; 64 SentinelConnected = 0;
63 UART_StartDMA_Receiption(); 65 UART_StartDMA_Receiption(&Uart1Ctrl);
64 localComState = UART_SENTINEL_IDLE; 66 localComState = UART_SENTINEL_IDLE;
65 } 67 }
66 externalInterface_SetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET,localComState); 68 externalInterface_SetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET,localComState);
67 } 69 }
68 70