comparison Small_CPU/Inc/uart.h @ 976:0b81ac558e89 Evo_2_23

Devbugfix UART buffer cleaning: In the previous version a buffer cleaning function was used which resets the ringbuffer read index. As result the processing of data was stopped until the DMA write comes to the index 0. When reaching it the complete buffer was proceeded including possibly invalid data. The usage of the cleanbuffer function was replaced by the flush buffer function (meaning the data is discarded but the data index is maintained). There was already a function for this. Because the function was 99% the same as the read function, it was integrated into the ReadData function. Calling the function with parameter flush = 1 will result in a buffer flush. The workaround of the previous revision was updated to only be applied in case a DiveO2 sensor is operated in stand alone mode.
author Ideenmodellierer
date Wed, 29 Jan 2025 17:21:20 +0100
parents 3029f0332f4f
children d9290c76b840
comparison
equal deleted inserted replaced
975:142f3d0363b3 976:0b81ac558e89
81 uint8_t UART_isSentinelConnected(); 81 uint8_t UART_isSentinelConnected();
82 void UART_setTargetChannel(uint8_t channel); 82 void UART_setTargetChannel(uint8_t channel);
83 void UART_MUX_SelectAddress(uint8_t muxAddress); 83 void UART_MUX_SelectAddress(uint8_t muxAddress);
84 void UART_SendCmdString(uint8_t *cmdString); 84 void UART_SendCmdString(uint8_t *cmdString);
85 void UART_SendCmdUbx(const uint8_t *cmd, uint8_t len); 85 void UART_SendCmdUbx(const uint8_t *cmd, uint8_t len);
86 void UART_ReadData(uint8_t sensorType); 86 void UART_ReadData(uint8_t sensorType, uint8_t flush);
87 void UART_WriteData(sUartComCtrl* pUartCtrl); 87 void UART_WriteData(sUartComCtrl* pUartCtrl);
88 void UART_FlushRxBuffer(void);
89 void UART_ChangeBaudrate(uint32_t newBaudrate); 88 void UART_ChangeBaudrate(uint32_t newBaudrate);
90 uint8_t UART_isComActive(uint8_t sensorId); 89 uint8_t UART_isComActive(uint8_t sensorId);
91 uint8_t UART_isEndIndication(sUartComCtrl* pCtrl, uint8_t index); 90 uint8_t UART_isEndIndication(sUartComCtrl* pCtrl, uint8_t index);
92 91
93 void StringToInt(char *pstr, uint32_t *puInt32); 92 void StringToInt(char *pstr, uint32_t *puInt32);