Update to v1.8.0 #100
@ -292,10 +292,12 @@ void initmission::createTestTasks(TaskFactory& factory, TaskDeadlineMissedFuncti
|
|||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
PeriodicTaskIF* testTask = factory.createPeriodicTask(
|
PeriodicTaskIF* testTask = factory.createPeriodicTask(
|
||||||
"TEST_TASK", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
|
"TEST_TASK", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
|
||||||
|
#if OBSW_ADD_TEST_TASK == 1
|
||||||
result = testTask->addComponent(objects::TEST_TASK);
|
result = testTask->addComponent(objects::TEST_TASK);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
||||||
}
|
}
|
||||||
|
#endif /* OBSW_ADD_TEST_TASK == 1 */
|
||||||
|
|
||||||
#if OBSW_ADD_SPI_TEST_CODE == 1
|
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||||
result = testTask->addComponent(objects::SPI_TEST);
|
result = testTask->addComponent(objects::SPI_TEST);
|
||||||
|
@ -529,8 +529,10 @@ void ObjectFactory::createHeaterComponents() {
|
|||||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
||||||
|
|
||||||
/* Pin H2-11 on stack connector */
|
/* Pin H2-11 on stack connector */
|
||||||
GpiodRegular* gpioConfigHeater0 = new GpiodRegular(q7s::GPIO_HEATER_CHIP,
|
GpiodRegular* gpioConfigHeater0 = new GpiodRegular("Heater0", gpio::OUT, 0, "axi_gpio_q7_3v3",
|
||||||
q7s::GPIO_HEATER_0_PIN, "Heater0", gpio::OUT, 0);
|
q7s::GPIO_HEATER_0_PIN);
|
||||||
|
// GpiodRegular* gpioConfigHeater0 = new GpiodRegular(q7s::GPIO_HEATER_CHIP,
|
||||||
|
// q7s::GPIO_HEATER_0_PIN, "Heater0", gpio::OUT, 0);
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_0, gpioConfigHeater0);
|
heaterGpiosCookie->addGpio(gpioIds::HEATER_0, gpioConfigHeater0);
|
||||||
|
|
||||||
/* Pin H2-12 on stack connector */
|
/* Pin H2-12 on stack connector */
|
||||||
@ -822,11 +824,15 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
|
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
|
||||||
|
#if OBSW_TEST_GPIO_LABEL == 1
|
||||||
/* Configure MIO0 as input */
|
/* Configure MIO0 as input */
|
||||||
GpiodRegular gpioConfigMio0(std::string("gpiochip0"), 0,
|
GpiodRegular* testGpio = new GpiodRegular("MIO0", gpio::OUT, 0, "/amba_pl/gpio@41200000", 0);
|
||||||
std::string("MIO0"), gpio::IN, 0);
|
#else
|
||||||
|
/* Configure MIO0 as input */
|
||||||
|
GpiodRegular* testGpio = new GpiodRegular("gpiochip0", 0, "MIO0", gpio::IN, 0);
|
||||||
|
#endif /* OBSW_TEST_GPIO_LABEL == 1 */
|
||||||
GpioCookie* gpioCookie = new GpioCookie;
|
GpioCookie* gpioCookie = new GpioCookie;
|
||||||
gpioCookie->addGpio(gpioIds::TEST_ID_0, gpioConfigMio0);
|
gpioCookie->addGpio(gpioIds::TEST_ID_0, testGpio);
|
||||||
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
|
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11,6 +11,10 @@ int simple::simple() {
|
|||||||
{
|
{
|
||||||
FileSystemTest fileSystemTest;
|
FileSystemTest fileSystemTest;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TE0720_GPIO_TEST
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
|
|||||||
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
|
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
|
||||||
}
|
}
|
||||||
gpioInterface->addGpios(gpioCookie);
|
gpioInterface->addGpios(gpioCookie);
|
||||||
testCase = TestCases::LOOPBACK;
|
testCase = TestCases::BLINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibgpiodTest::~LibgpiodTest() {
|
LibgpiodTest::~LibgpiodTest() {
|
||||||
@ -29,7 +29,7 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
|||||||
case(TestCases::READ): {
|
case(TestCases::READ): {
|
||||||
result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState);
|
result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
@ -42,6 +42,38 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
|||||||
case(TestCases::LOOPBACK): {
|
case(TestCases::LOOPBACK): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case(TestCases::BLINK): {
|
||||||
|
result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||||
|
<< std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
if (gpioState == 1) {
|
||||||
|
result = gpioInterface->pullLow(gpioIds::TEST_ID_0);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO low!"
|
||||||
|
<< std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (gpioState == 0) {
|
||||||
|
result = gpioInterface->pullHigh(gpioIds::TEST_ID_0);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO high!"
|
||||||
|
<< std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sif::warning << "LibgpiodTest::performPeriodicAction: Invalid GPIO state" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
sif::debug << "LibgpiodTest::performPeriodicAction: Invalid test case" << std::endl;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -56,6 +88,9 @@ ReturnValue_t LibgpiodTest::performOneShotAction() {
|
|||||||
case(TestCases::READ): {
|
case(TestCases::READ): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case(TestCases::BLINK): {
|
||||||
|
break;
|
||||||
|
}
|
||||||
case(TestCases::LOOPBACK): {
|
case(TestCases::LOOPBACK): {
|
||||||
result = gpioInterface->pullHigh(gpioIds::TEST_ID_0);
|
result = gpioInterface->pullHigh(gpioIds::TEST_ID_0);
|
||||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
if(result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -14,7 +14,8 @@ class LibgpiodTest: public TestTask {
|
|||||||
public:
|
public:
|
||||||
enum TestCases {
|
enum TestCases {
|
||||||
READ = 0,
|
READ = 0,
|
||||||
LOOPBACK = 1
|
LOOPBACK = 1,
|
||||||
|
BLINK
|
||||||
};
|
};
|
||||||
|
|
||||||
TestCases testCase;
|
TestCases testCase;
|
||||||
|
@ -59,6 +59,7 @@ debugging. */
|
|||||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||||
#define OBSW_TEST_CCSDS_PTME 0
|
#define OBSW_TEST_CCSDS_PTME 0
|
||||||
#define OBSW_TEST_TE7020_HEATER 0
|
#define OBSW_TEST_TE7020_HEATER 0
|
||||||
|
#define OBSW_TEST_GPIO_LABEL 0
|
||||||
|
|
||||||
#define OBSW_DEBUG_P60DOCK 0
|
#define OBSW_DEBUG_P60DOCK 0
|
||||||
#define OBSW_DEBUG_PDU1 0
|
#define OBSW_DEBUG_PDU1 0
|
||||||
|
Loading…
Reference in New Issue
Block a user