parameter upstream taken over

This commit is contained in:
Robin Müller 2020-12-22 16:17:15 +01:00
parent c174c9ecb8
commit f6e7e232f5
2 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ParameterHelper.cpp
ParameterMessage.cpp
ParameterWrapper.cpp
)

View File

@ -123,7 +123,8 @@ ReturnValue_t ParameterWrapper::deSerializeData(uint8_t startingRow,
for (uint8_t fromRow = 0; fromRow < fromRows; fromRow++) { for (uint8_t fromRow = 0; fromRow < fromRows; fromRow++) {
//get the start element of this row in data //get the start element of this row in data
uint16_t offset = (((startingRow + fromRow) * columns) + startingColumn); uint16_t offset = (((startingRow + fromRow) *
static_cast<uint16_t>(columns)) + startingColumn);
T *dataWithDataType = static_cast<T*>(data) + offset; T *dataWithDataType = static_cast<T*>(data) + offset;
for (uint8_t fromColumn = 0; fromColumn < fromColumns; fromColumn++) { for (uint8_t fromColumn = 0; fromColumn < fromColumns; fromColumn++) {
@ -296,8 +297,8 @@ ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from,
//need a type to do arithmetic //need a type to do arithmetic
uint8_t* typedData = static_cast<uint8_t*>(data); uint8_t* typedData = static_cast<uint8_t*>(data);
for (uint8_t fromRow = 0; fromRow < from->rows; fromRow++) { for (uint8_t fromRow = 0; fromRow < from->rows; fromRow++) {
size_t offset = (((startingRow + fromRow) * columns) + size_t offset = (((startingRow + fromRow) * static_cast<uint16_t>(
startingColumn) * typeSize; columns)) + startingColumn) * typeSize;
std::memcpy(typedData + offset, from->readonlyData, std::memcpy(typedData + offset, from->readonlyData,
typeSize * from->columns); typeSize * from->columns);
} }