WIP: SCEX Init #272

Closed
muellerr wants to merge 62 commits from irini into develop
7 changed files with 52 additions and 0 deletions
Showing only changes of commit df712c7100 - Show all commits

View File

@ -228,7 +228,15 @@ void initmission::createTestTasks(TaskFactory& factory,
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("UART_TEST", objects::UART_TEST);
}
PeriodicTaskIF* scexReaderTask = factory.createPeriodicTask(
"SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
result = scexReaderTask->addComponent(objects::SCEX_UART_READER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER);
}
#endif /* RPI_ADD_GPIO_TEST == 1 */
taskVec.push_back(scexReaderTask);
taskVec.push_back(testTask);
bool startTestPst = true;

View File

@ -1,3 +1,4 @@
#include <linux/devices/ScexUartReader.h>
#include "ObjectFactory.h"
#include "OBSWConfig.h"
@ -182,6 +183,7 @@ void ObjectFactory::createTestTasks() {
#endif
#if OBSW_ADD_UART_TEST_CODE == 1
new ScexUartReader(objects::SCEX_UART_READER);
new UartTestClass(objects::UART_TEST);
#else
new UartComIF(objects::UART_COM_IF);

View File

@ -197,6 +197,7 @@ void UartTestClass::scexPeriodic() {
sif::info << "Received " << bytesRead
<< " bytes from the Solar Cell Experiment:" << std::endl;
arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false);
break;
}
} while (bytesRead > 0);
}

View File

@ -4,4 +4,7 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER)
)
endif()
target_sources(${OBSW_NAME} PRIVATE
ScexUartReader.cpp
)
add_subdirectory(startracker)

View File

@ -0,0 +1,18 @@
#include "ScexUartReader.h"
#include <iostream>
ScexUartReader::ScexUartReader(object_id_t objectId):SystemObject(objectId) {
}
void ScexUartRead::start() {
semaphore->give();
}
ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
std::cout<<"hallo welt"<<std::endl;
semaphore->take();
while(true) {
semaphore->take();
}
return RETURN_OK;
}

View File

@ -0,0 +1,18 @@
#ifndef LINUX_DEVICES_SCEXUARTREADER_H_
#define LINUX_DEVICES_SCEXUARTREADER_H_
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
class ScexUartReader: public SystemObject, //strg+shift+n
public ExecutableObjectIF,
public HasReturnvaluesIF {
public:
ScexUartReader(object_id_t objectId);
private:
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
};
#endif /* LINUX_DEVICES_SCEXUARTREADER_H_ */

View File

@ -49,6 +49,7 @@ enum sourceObjects : uint32_t {
UART_COM_IF = 0x49030003,
SPI_COM_IF = 0x49020004,
GPIO_IF = 0x49010005,
SCEX_UART_READER = 0x49010006,
/* Custom device handler */
PCDU_HANDLER = 0x442000A1,
@ -57,6 +58,7 @@ enum sourceObjects : uint32_t {
HEATER_HANDLER = 0x444100A4,
RAD_SENSOR = 0x443200A5,
/* 0x54 ('T') for test handlers */
TEST_TASK = 0x54694269,
LIBGPIOD_TEST = 0x54123456,