Update to v1.8.0 #100

Merged
muellerr merged 125 commits from develop into main 2021-09-24 10:17:43 +02:00
5 changed files with 26 additions and 9 deletions
Showing only changes of commit 00bafd98fe - Show all commits

View File

@ -457,7 +457,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER,
objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_A); objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_A);
mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setStartUpImmediately();
mgmRm3100Handler->setToGoToNormalMode(true); //mgmRm3100Handler->setToGoToNormalMode(true);
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev, spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
@ -470,7 +470,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER,
objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_B); objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_B);
mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setStartUpImmediately();
mgmRm3100Handler->setToGoToNormalMode(true); //mgmRm3100Handler->setToGoToNormalMode(true);
// Commented until ACS board V2 in in clean room again // Commented until ACS board V2 in in clean room again
// Gyro 0 Side A // Gyro 0 Side A
@ -502,6 +502,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setStartUpImmediately();
//gyroL3gHandler->setGoNormalModeAtStartup(); //gyroL3gHandler->setGoNormalModeAtStartup();
bool debugGps = false;
#if OBSW_DEBUG_GPS == 1
debugGps = true;
#endif
resetArgsGnss1.gnss1 = true; resetArgsGnss1.gnss1 = true;
resetArgsGnss1.gpioComIF = gpioComIF; resetArgsGnss1.gpioComIF = gpioComIF;
resetArgsGnss1.waitPeriodMs = 100; resetArgsGnss1.waitPeriodMs = 100;
@ -517,11 +521,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
uartCookieGps1->setToFlushInput(true); uartCookieGps1->setToFlushInput(true);
uartCookieGps1->setReadCycles(6); uartCookieGps1->setReadCycles(6);
auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF,
uartCookieGps0, true); uartCookieGps0, debugGps);
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
gpsHandler0->setStartUpImmediately(); gpsHandler0->setStartUpImmediately();
auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF,
uartCookieGps1, true); uartCookieGps1, debugGps);
gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1); gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1);
gpsHandler1->setStartUpImmediately(); gpsHandler1->setStartUpImmediately();
} }

View File

@ -26,10 +26,10 @@ static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000; static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000;
static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3; static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t RW_SPEED = 300000; static constexpr uint32_t RW_SPEED = 300'000;
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0; static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
static constexpr uint32_t RTD_SPEED = 2000000; static constexpr uint32_t RTD_SPEED = 2'000'000;
} }

View File

@ -63,6 +63,7 @@ debugging. */
#define OBSW_DEBUG_P60DOCK 0 #define OBSW_DEBUG_P60DOCK 0
#define OBSW_DEBUG_PDU1 0 #define OBSW_DEBUG_PDU1 0
#define OBSW_DEBUG_PDU2 0 #define OBSW_DEBUG_PDU2 0
#define OBSW_DEBUG_GPS 0
#define OBSW_DEBUG_ACU 0 #define OBSW_DEBUG_ACU 0
#define OBSW_DEBUG_SYRLINKS 0 #define OBSW_DEBUG_SYRLINKS 0
#define OBSW_DEBUG_IMQT 0 #define OBSW_DEBUG_IMQT 0

View File

@ -23,7 +23,6 @@ GPSHyperionHandler::~GPSHyperionHandler() {}
void GPSHyperionHandler::doStartUp() { void GPSHyperionHandler::doStartUp() {
if(internalState == InternalStates::NONE) { if(internalState == InternalStates::NONE) {
commandExecuted = false; commandExecuted = false;
updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
internalState = InternalStates::WAIT_FIRST_MESSAGE; internalState = InternalStates::WAIT_FIRST_MESSAGE;
} }
@ -76,7 +75,7 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) { DeviceCommandId_t *foundId, size_t *foundLen) {
// Pass data to GPS library // Pass data to GPS library
if(len > 0) { if(len > 0) {
sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl; // sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl;
if (internalState == InternalStates::WAIT_FIRST_MESSAGE) { if (internalState == InternalStates::WAIT_FIRST_MESSAGE) {
// TODO: Check whether data is valid by checking whether NMEA start string is valid? // TODO: Check whether data is valid by checking whether NMEA start string is valid?
commandExecuted = true; commandExecuted = true;
@ -202,3 +201,12 @@ void GPSHyperionHandler::setResetPinTriggerFunction(gpioResetFunction_t resetCal
void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId, void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId,
uint32_t parameter) { uint32_t parameter) {
} }
ReturnValue_t GPSHyperionHandler::initialize() {
ReturnValue_t result = DeviceHandlerBase::initialize();
if(result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
// Enable reply immediately for now
return updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
}

View File

@ -14,12 +14,16 @@
*/ */
class GPSHyperionHandler: public DeviceHandlerBase { class GPSHyperionHandler: public DeviceHandlerBase {
public: public:
using gpioResetFunction_t = ReturnValue_t (*) (void* args);
GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF* comCookie, bool debugHyperionGps = false); CookieIF* comCookie, bool debugHyperionGps = false);
virtual ~GPSHyperionHandler(); virtual ~GPSHyperionHandler();
using gpioResetFunction_t = ReturnValue_t (*) (void* args);
void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args); void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args);
ReturnValue_t initialize() override;
protected: protected:
gpioResetFunction_t resetCallback = nullptr; gpioResetFunction_t resetCallback = nullptr;