small bugfix for rm3100
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
39acc24535
commit
c7d0a9551e
@ -212,7 +212,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen
|
||||
result = HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
cookie->assignTransferSize(decodedFrameLen);
|
||||
cookie->setTransferSize(decodedFrameLen);
|
||||
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
|
||||
|
@ -482,8 +482,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
||||
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev,
|
||||
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
objects::SPI_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
//gyroL3gHandler->setGoNormalModeAtStartup();
|
||||
// Gyro 2 Side B
|
||||
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
||||
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
||||
@ -495,8 +496,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
||||
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev,
|
||||
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
objects::SPI_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
//gyroL3gHandler->setGoNormalModeAtStartup();
|
||||
|
||||
resetArgsGnss1.gnss1 = true;
|
||||
resetArgsGnss1.gpioComIF = gpioComIF;
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 97494a84dfd0acb9dc32770ae9d142f80d4bbcfa
|
||||
Subproject commit bdd7d59d82a0b9290d77844fbcc5be61c61bcbcb
|
@ -74,5 +74,6 @@ static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048;
|
||||
|
||||
#define FSFW_HAL_LINUX_SPI_WIRETAPPING 0
|
||||
#define FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV 0
|
||||
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0
|
||||
|
||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
||||
|
@ -446,7 +446,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
// DeviceHandlerIF::SEND_READ);
|
||||
// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
//
|
||||
////
|
||||
// thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0,
|
||||
// DeviceHandlerIF::PERFORM_OPERATION);
|
||||
// thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.2,
|
||||
@ -469,28 +469,28 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
// thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.2,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.4,
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.8,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0,
|
||||
// DeviceHandlerIF::PERFORM_OPERATION);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2,
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.2,
|
||||
// DeviceHandlerIF::SEND_WRITE);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4,
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.4,
|
||||
// DeviceHandlerIF::GET_WRITE);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6,
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6,
|
||||
// DeviceHandlerIF::SEND_READ);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8,
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4,
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
|
||||
// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0,
|
||||
// DeviceHandlerIF::PERFORM_OPERATION);
|
||||
// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.2,
|
||||
|
@ -403,7 +403,7 @@ ReturnValue_t GyroADIS16507Handler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
||||
cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
|
||||
comIf->setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
|
||||
cookie->assignWriteBuffer(sendData);
|
||||
cookie->assignTransferSize(2);
|
||||
cookie->setTransferSize(2);
|
||||
|
||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
||||
|
@ -292,14 +292,14 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "MGMHandlerLIS3: Magnetic field strength in"
|
||||
" microtesla:" << std::endl;
|
||||
sif::info << "X: " << mgmX << " \xC2\xB5T" << std::endl;
|
||||
sif::info << "Y: " << mgmY << " \xC2\xB5T" << std::endl;
|
||||
sif::info << "Z: " << mgmZ << " \xC2\xB5T" << std::endl;
|
||||
sif::info << "X: " << mgmX << " uT" << std::endl;
|
||||
sif::info << "Y: " << mgmY << " uT" << std::endl;
|
||||
sif::info << "Z: " << mgmZ << " uT" << std::endl;
|
||||
#else
|
||||
sif::printInfo("MGMHandlerLIS3: Magnetic field strength in microtesla:\n");
|
||||
sif::printInfo("X: %f " "\xC2\xB5" "T\n", mgmX);
|
||||
sif::printInfo("Y: %f " "\xC2\xB5" "T\n", mgmY);
|
||||
sif::printInfo("Z: %f " "\xC2\xB5" "T\n", mgmZ);
|
||||
sif::printInfo("X: %f uT\n", mgmX);
|
||||
sif::printInfo("Y: %f uT\n", mgmY);
|
||||
sif::printInfo("Z: %f uT\n", mgmZ);
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */
|
||||
}
|
||||
#endif /* OBSW_VERBOSE_LEVEL >= 1 */
|
||||
@ -320,10 +320,10 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
|
||||
if(debugDivider->check()) {
|
||||
/* Set terminal to utf-8 if there is an issue with micro printout. */
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "MGMHandlerLIS3: Temperature: " << tempValue << " \xC2\xB0" << "C" <<
|
||||
sif::info << "MGMHandlerLIS3: Temperature: " << tempValue << " C" <<
|
||||
std::endl;
|
||||
#else
|
||||
sif::printInfo("MGMHandlerLIS3: Temperature: %f" "\xC2\xB0" "C\n");
|
||||
sif::printInfo("MGMHandlerLIS3: Temperature: %f C\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -63,6 +63,7 @@ void MGMHandlerRM3100::doShutDown() {
|
||||
|
||||
ReturnValue_t MGMHandlerRM3100::buildTransitionDeviceCommand(
|
||||
DeviceCommandId_t *id) {
|
||||
size_t commandLen = 0;
|
||||
switch(internalState) {
|
||||
case(InternalState::NONE):
|
||||
case(InternalState::NORMAL): {
|
||||
@ -77,6 +78,8 @@ ReturnValue_t MGMHandlerRM3100::buildTransitionDeviceCommand(
|
||||
break;
|
||||
}
|
||||
case(InternalState::STATE_CONFIGURE_TMRC): {
|
||||
commandBuffer[0] = RM3100::TMRC_DEFAULT_VALUE;
|
||||
commandLen = 1;
|
||||
*id = RM3100::CONFIGURE_TMRC;
|
||||
break;
|
||||
}
|
||||
@ -85,18 +88,17 @@ ReturnValue_t MGMHandlerRM3100::buildTransitionDeviceCommand(
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* Might be a configuration error. */
|
||||
sif::debug << "GyroHandler::buildTransitionDeviceCommand: Unknown internal state!" <<
|
||||
// Might be a configuration error
|
||||
sif::warning << "MGMHandlerRM3100::buildTransitionDeviceCommand: Unknown internal state!" <<
|
||||
std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
return buildCommandFromCommand(*id, commandBuffer, commandLen);
|
||||
}
|
||||
|
||||
ReturnValue_t MGMHandlerRM3100::buildCommandFromCommand(
|
||||
DeviceCommandId_t deviceCommand, const uint8_t *commandData,
|
||||
size_t commandDataLen) {
|
||||
ReturnValue_t MGMHandlerRM3100::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||
const uint8_t *commandData, size_t commandDataLen) {
|
||||
switch(deviceCommand) {
|
||||
case(RM3100::CONFIGURE_CMM): {
|
||||
commandBuffer[0] = RM3100::CMM_REGISTER;
|
||||
@ -113,8 +115,7 @@ ReturnValue_t MGMHandlerRM3100::buildCommandFromCommand(
|
||||
break;
|
||||
}
|
||||
case(RM3100::CONFIGURE_TMRC): {
|
||||
return handleTmrcConfigCommand(deviceCommand, commandData,
|
||||
commandDataLen);
|
||||
return handleTmrcConfigCommand(deviceCommand, commandData, commandDataLen);
|
||||
}
|
||||
case(RM3100::READ_TMRC): {
|
||||
commandBuffer[0] = RM3100::TMRC_REGISTER | RM3100::READ_MASK;
|
||||
@ -124,8 +125,7 @@ ReturnValue_t MGMHandlerRM3100::buildCommandFromCommand(
|
||||
break;
|
||||
}
|
||||
case(RM3100::CONFIGURE_CYCLE_COUNT): {
|
||||
return handleCycleCountConfigCommand(deviceCommand, commandData,
|
||||
commandDataLen);
|
||||
return handleCycleCountConfigCommand(deviceCommand, commandData, commandDataLen);
|
||||
}
|
||||
case(RM3100::READ_CYCLE_COUNT): {
|
||||
commandBuffer[0] = RM3100::CYCLE_COUNT_START_REGISTER | RM3100::READ_MASK;
|
||||
@ -162,8 +162,7 @@ ReturnValue_t MGMHandlerRM3100::scanForReply(const uint8_t *start,
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t MGMHandlerRM3100::interpretDeviceReply(
|
||||
DeviceCommandId_t id, const uint8_t *packet) {
|
||||
ReturnValue_t MGMHandlerRM3100::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
switch(id) {
|
||||
case(RM3100::CONFIGURE_CMM):
|
||||
@ -281,19 +280,14 @@ ReturnValue_t MGMHandlerRM3100::handleCycleCommand(bool oneCycleValue,
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t MGMHandlerRM3100::handleTmrcConfigCommand(
|
||||
DeviceCommandId_t deviceCommand, const uint8_t *commandData,
|
||||
size_t commandDataLen) {
|
||||
if(commandData == nullptr) {
|
||||
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
|
||||
}
|
||||
|
||||
if(commandDataLen != 1) {
|
||||
ReturnValue_t MGMHandlerRM3100::handleTmrcConfigCommand(DeviceCommandId_t deviceCommand,
|
||||
const uint8_t *commandData, size_t commandDataLen) {
|
||||
if(commandData == nullptr or commandDataLen != 1) {
|
||||
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
|
||||
}
|
||||
|
||||
commandBuffer[0] = RM3100::TMRC_REGISTER;
|
||||
commandBuffer[1] = commandData[1];
|
||||
commandBuffer[1] = commandData[0];
|
||||
rawPacketLen = 2;
|
||||
rawPacket = commandBuffer;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
@ -325,7 +319,7 @@ ReturnValue_t MGMHandlerRM3100::initializeLocalDataPool(
|
||||
}
|
||||
|
||||
uint32_t MGMHandlerRM3100::getTransitionDelayMs(Mode_t from, Mode_t to) {
|
||||
return 10000;
|
||||
return 25000;
|
||||
}
|
||||
|
||||
ReturnValue_t MGMHandlerRM3100::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) {
|
||||
|
@ -45,7 +45,7 @@ static constexpr uint8_t TMRC_75HZ_VALUE = 0x95;
|
||||
static constexpr uint8_t TMRC_DEFAULT_37HZ_VALUE = 0x96;
|
||||
|
||||
static constexpr uint8_t TMRC_REGISTER = 0x0B;
|
||||
static constexpr uint8_t TMRC_DEFAULT_VALUE = TMRC_DEFAULT_37HZ_VALUE;
|
||||
static constexpr uint8_t TMRC_DEFAULT_VALUE = TMRC_75HZ_VALUE;
|
||||
|
||||
static constexpr uint8_t MEASUREMENT_REG_START = 0x24;
|
||||
static constexpr uint8_t BIST_REGISTER = 0x33;
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit d9968031d641249ca0ad62e7c1c19ed22390078c
|
||||
Subproject commit dff569e93ff3cb5e62627c89cfa2229f464c76de
|
Loading…
Reference in New Issue
Block a user