Skip to content

Commit

Permalink
RX CRC optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Apr 19, 2023
1 parent 6990b8c commit 9d0aac8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions network/robus/src/reception.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data)
return;
}


// We complete the header reception, we need to compute all the needed values.
// Compute message header size, keep, ... the result will be available in phy_robus->rx_size, ...
Phy_Computeheader(phy_robus);
Expand All @@ -154,7 +153,7 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data)
default:
break;
}
RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val);
RobusHAL_ComputeCRC((uint8_t *)&phy_robus->rx_data[phy_robus->received_data - 1], (uint8_t *)&crc_val);
}
/******************************************************************************
* @brief Callback to get a complete data
Expand All @@ -175,7 +174,7 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data)
// Catch the byte.
phy_robus->rx_data[phy_robus->received_data] = *data;
// Continue the CRC computation until the end of data
RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val);
RobusHAL_ComputeCRC((uint8_t *)&phy_robus->rx_data[phy_robus->received_data], (uint8_t *)&crc_val);
}
else if (phy_robus->received_data > phy_robus->rx_size)
{
Expand Down

0 comments on commit 9d0aac8

Please sign in to comment.