some reaction wheel fixes
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2021-11-30 16:45:33 +01:00
parent d287aa80c1
commit 77f6ac57e9
4 changed files with 19 additions and 3 deletions

View File

@ -133,8 +133,15 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen
closeSpi(gpioId, gpioIF, mutex);
return RwHandler::SPI_READ_FAILURE;
}
if(idx == 0) {
if(byteRead != FLAG_BYTE) {
sif::error << "Invalid data, expected start marker" << std::endl;
closeSpi(gpioId, gpioIF, mutex);
return RwHandler::NO_START_MARKER;
}
}
if (byteRead != 0x7E) {
if (byteRead != FLAG_BYTE) {
break;
}
@ -145,6 +152,10 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen
}
}
#if FSFW_HAL_SPI_WIRETAPPING == 1
sif::info << "RW start marker detected" << std::endl;
#endif
size_t decodedFrameLen = 0;
while(decodedFrameLen < replyBufferSize) {
@ -158,7 +169,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen
}
}
if (byteRead == 0x7E) {
if (byteRead == FLAG_BYTE) {
/** Reached end of frame */
break;
}