Issue #18: ECU STM32 Implement Communication Hub#40
Open
hasslesstech wants to merge 17 commits intomainfrom
Open
Issue #18: ECU STM32 Implement Communication Hub#40hasslesstech wants to merge 17 commits intomainfrom
hasslesstech wants to merge 17 commits intomainfrom
Conversation
…num updations with included validation measures
ULog now sends messages over the wire only if it is connected, correctly logs messages in KPIRover_Init() and does not cause hardfaults due to overflowing the message queue. Default task does not cause HardFault due to overflowing it's stack. ulStorage is initialized in KPIRover_Init(). ulDatabase metadata order has been corrected.
6 tasks
|
|
||
| static uint16_t crc_table[UINT8_MAX + 1]; | ||
|
|
||
| uint16_t crc16( const unsigned char *buf, unsigned int len ) |
Member
There was a problem hiding this comment.
Signature mismatch
crc16.h: uint16_t crc16(uint8_t const *data, size_t size);
| struct ulDatabase_ParamMetadata *p = ulDatabase_getMetadata(i); | ||
|
|
||
| if (p == NULL) | ||
| return false; |
Member
There was a problem hiding this comment.
Returning false is by design? The function type is uint32.
|
|
||
| bool drvUart_send(uint8_t * const buf) | ||
| { | ||
| memcpy(transmitBuffer + 1, buf, buf[0]); |
Member
There was a problem hiding this comment.
Is it possible to have out of array problem?
| } | ||
|
|
||
| void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { | ||
| on_tx_cplt(); |
Member
There was a problem hiding this comment.
I suggest to check for NULL
| (void) osMessageQueueGet(recvQ, recvBuffer, NULL, osWaitForever); | ||
|
|
||
| *size = recvBuffer[0] - 1; | ||
| memcpy(buf, recvBuffer + 1, *size); |
Member
There was a problem hiding this comment.
Here also I prefer control size. What if recvBuffer[0] == 0?
| #define DRV_UART_TRANSMIT_BUFFER_SIZE 53 | ||
|
|
||
| bool drvUart_start(void); | ||
| bool drvUart_on_rx_cplt(void (*f)(const uint8_t * const buffer)); |
|
|
||
| bool drvUart_start(void); | ||
| bool drvUart_on_rx_cplt(void (*f)(const uint8_t * const buffer)); | ||
| bool drvUart_on_tx_cplt(void (*f)(void)); |
|
|
||
| void ProtocolHandler_init(void) | ||
| { | ||
| for (uint32_t i = 0; i < 256; i++) { |
|
|
||
| for ( ; ; ) { | ||
| UARTTransport_receive(recvBuffer, &recvSize); | ||
| dispatch_table[recvBuffer[0]](); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.