fixed conflicts
This commit is contained in:
@ -3,16 +3,16 @@
|
||||
|
||||
namespace q7s {
|
||||
|
||||
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spidev2.0";
|
||||
static constexpr char SPI_RW_DEV[] = "/dev/spidev3.0";
|
||||
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main";
|
||||
static constexpr char SPI_RW_DEV[] = "/dev/spi-rw";
|
||||
|
||||
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-0";
|
||||
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
|
||||
|
||||
static constexpr char UART_GNSS_DEV[] = "/dev/ttyUL0";
|
||||
static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ttyUL2";
|
||||
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ttyUL3";
|
||||
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ttyUL4";
|
||||
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ttyUL7";
|
||||
static constexpr char UART_GNSS_DEV[] = "/dev/ul-gps";
|
||||
static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul-plmpsoc";
|
||||
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
|
||||
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
|
||||
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
|
||||
|
||||
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
|
||||
static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2";
|
||||
@ -43,6 +43,7 @@ static constexpr char GNSS_0_ENABLE[] = "enable_gnss_0";
|
||||
static constexpr char GNSS_1_ENABLE[] = "enable_gnss_1";
|
||||
static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0";
|
||||
static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2";
|
||||
static constexpr char GNSS_SELECT[] = "gnss_mux_select";
|
||||
static constexpr char HEATER_0[] = "heater0";
|
||||
static constexpr char HEATER_1[] = "heater1";
|
||||
static constexpr char HEATER_2[] = "heater2";
|
||||
|
@ -248,6 +248,8 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
taskVec.push_back(gpioPst);
|
||||
|
||||
#if OBSW_ADD_I2C_TEST_CODE == 0
|
||||
FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask(
|
||||
"I2C_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
result = pst::pstI2c(i2cPst);
|
||||
@ -255,6 +257,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
taskVec.push_back(i2cPst);
|
||||
#endif
|
||||
|
||||
FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask(
|
||||
"GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
@ -263,7 +266,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl;
|
||||
}
|
||||
taskVec.push_back(gomSpacePstTask);
|
||||
#else /* BOARD_TE7020 == 0 */
|
||||
#else /* BOARD_TE7020 == 0 */
|
||||
FixedTimeslotTaskIF* pollingSequenceTaskTE0720 = factory.createFixedTimeslotTask(
|
||||
"PST_TASK_TE0720", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE * 8, 3.0, missedDeadlineFunc);
|
||||
result = pst::pollingSequenceTE0720(pollingSequenceTaskTE0720);
|
||||
@ -347,7 +350,7 @@ void initmission::createPusTasks(TaskFactory& factory,
|
||||
void initmission::createTestTasks(TaskFactory& factory,
|
||||
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||
#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || \
|
||||
#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || OBSW_ADD_I2C_TEST_CODE == 1 || \
|
||||
(BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1)
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
#endif
|
||||
@ -366,6 +369,12 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST);
|
||||
}
|
||||
#endif
|
||||
#if OBSW_ADD_I2C_TEST_CODE == 1
|
||||
result = testTask->addComponent(objects::I2C_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("I2C_TEST", objects::I2C_TEST);
|
||||
}
|
||||
#endif
|
||||
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
|
||||
result = testTask->addComponent(objects::LIBGPIOD_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <linux/boardtest/I2cTestClass.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
@ -45,6 +47,7 @@
|
||||
#include "linux/devices/devicedefinitions/SusDefinitions.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/devices/ACUHandler.h"
|
||||
#include "mission/devices/BpxBatteryHandler.h"
|
||||
#include "mission/devices/GPSHyperionLinuxController.h"
|
||||
#include "mission/devices/GyroADIS1650XHandler.h"
|
||||
#include "mission/devices/HeaterHandler.h"
|
||||
@ -117,7 +120,8 @@ void ObjectFactory::produce(void* args) {
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
UartComIF* uartComIF = nullptr;
|
||||
SpiComIF* spiComIF = nullptr;
|
||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF);
|
||||
I2cComIF* i2cComIF = nullptr;
|
||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
|
||||
createTmpComponents();
|
||||
#if BOARD_TE0720 == 0
|
||||
new CoreController(objects::CORE_CONTROLLER);
|
||||
@ -144,6 +148,7 @@ void ObjectFactory::produce(void* args) {
|
||||
I2cCookie* imtqI2cCookie =
|
||||
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
|
||||
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
|
||||
static_cast<void>(imtqHandler);
|
||||
#if OBSW_DEBUG_IMTQ == 1
|
||||
imtqHandler->setToGoToNormal(true);
|
||||
imtqHandler->setStartUpImmediately();
|
||||
@ -153,6 +158,18 @@ void ObjectFactory::produce(void* args) {
|
||||
#endif
|
||||
createReactionWheelComponents(gpioComIF);
|
||||
|
||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
|
||||
BpxBatteryHandler* bpxHandler =
|
||||
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
|
||||
#if OBSW_TEST_BPX_BATT == 1
|
||||
bpxHandler->setToGoToNormalMode(true);
|
||||
bpxHandler->setStartUpImmediately();
|
||||
#else
|
||||
static_cast<void>(bpxHandler);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
UartCookie* plocMpsocCookie =
|
||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV,
|
||||
@ -222,7 +239,7 @@ void ObjectFactory::createTmpComponents() {
|
||||
}
|
||||
|
||||
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF) {
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF) {
|
||||
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) {
|
||||
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
|
||||
<< std::endl;
|
||||
@ -231,7 +248,7 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
||||
|
||||
/* Communication interfaces */
|
||||
new CspComIF(objects::CSP_COM_IF);
|
||||
new I2cComIF(objects::I2C_COM_IF);
|
||||
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
||||
*uartComIF = new UartComIF(objects::UART_COM_IF);
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 0
|
||||
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF);
|
||||
@ -481,6 +498,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
gpio::LOW);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio);
|
||||
|
||||
// Select pin. 0 for GPS side A, 1 for GPS side B
|
||||
consumer.str("");
|
||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), gpio::DIR_OUT,
|
||||
gpio::LOW);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
|
||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
@ -578,7 +601,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
resetArgsGnss0.gnss1 = false;
|
||||
resetArgsGnss0.gpioComIF = gpioComIF;
|
||||
resetArgsGnss0.waitPeriodMs = 100;
|
||||
auto gpsHandler0 = new GPSHyperionHandler(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
||||
auto gpsHandler0 =
|
||||
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
}
|
||||
@ -1108,4 +1132,7 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||
new SpiTestClass(objects::SPI_TEST, gpioComIF);
|
||||
#endif
|
||||
#if OBSW_ADD_I2C_TEST_CODE == 1
|
||||
new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV);
|
||||
#endif
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
class LinuxLibgpioIF;
|
||||
class UartComIF;
|
||||
class SpiComIF;
|
||||
class I2cComIF;
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
@ -11,7 +12,7 @@ void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF);
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
||||
void createTmpComponents();
|
||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
|
Reference in New Issue
Block a user