Merge remote-tracking branch 'origin/development' into mueller/master
This commit is contained in:
commit
5471030c32
@ -52,11 +52,18 @@ static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
|||||||
|
|
||||||
//! Defines the FIFO depth of each commanding service base which
|
//! Defines the FIFO depth of each commanding service base which
|
||||||
//! also determines how many commands a CSB service can handle in one cycle
|
//! also determines how many commands a CSB service can handle in one cycle
|
||||||
//! simulataneously. This will increase the required RAM for
|
//! simultaneously. This will increase the required RAM for
|
||||||
//! each CSB service !
|
//! each CSB service !
|
||||||
static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6;
|
static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6;
|
||||||
|
|
||||||
static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124;
|
static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124;
|
||||||
|
|
||||||
|
//! Defines if the real time scheduler for linux should be used.
|
||||||
|
//! If set to 0, this will also disable priority settings for linux
|
||||||
|
//! as most systems will not allow to set nice values without privileges
|
||||||
|
//! For embedded linux system set this to 1.
|
||||||
|
//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run
|
||||||
|
#define FSFW_USE_REALTIME_FOR_LINUX 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
#endif /* CONFIG_FSFWCONFIG_H_ */
|
||||||
|
@ -81,11 +81,17 @@ void HealthTable::printAll(uint8_t* pointer, size_t maxSize) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const auto& health: healthMap) {
|
for (const auto& health: healthMap) {
|
||||||
SerializeAdapter::serialize(&health.first,
|
result = SerializeAdapter::serialize(&health.first,
|
||||||
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
&pointer, &size, maxSize, SerializeIF::Endianness::BIG);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
uint8_t healthValue = health.second;
|
uint8_t healthValue = health.second;
|
||||||
SerializeAdapter::serialize(&healthValue, &pointer, &size,
|
result = SerializeAdapter::serialize(&healthValue, &pointer, &size,
|
||||||
maxSize, SerializeIF::Endianness::BIG);
|
maxSize, SerializeIF::Endianness::BIG);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +102,7 @@ ReturnValue_t HealthTable::iterate(HealthEntry *value, bool reset) {
|
|||||||
mapIterator = healthMap.begin();
|
mapIterator = healthMap.begin();
|
||||||
}
|
}
|
||||||
if (mapIterator == healthMap.end()) {
|
if (mapIterator == healthMap.end()) {
|
||||||
result = HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
*value = *mapIterator;
|
*value = *mapIterator;
|
||||||
mapIterator++;
|
mapIterator++;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "../../ipc/MutexFactory.h"
|
#include "../../ipc/MutexFactory.h"
|
||||||
#include "../../osal/host/Mutex.h"
|
#include "../../osal/host/Mutex.h"
|
||||||
#include "../../osal/host/FixedTimeslotTask.h"
|
#include "../../osal/host/FixedTimeslotTask.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterface.h"
|
||||||
#include "../../tasks/ExecutableObjectIF.h"
|
#include "../../tasks/ExecutableObjectIF.h"
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
@ -21,7 +21,7 @@ PeriodicTask::PeriodicTask(const char *name, TaskPriority setPriority,
|
|||||||
void (*setDeadlineMissedFunc)()) :
|
void (*setDeadlineMissedFunc)()) :
|
||||||
started(false), taskName(name), period(setPeriod),
|
started(false), taskName(name), period(setPeriod),
|
||||||
deadlineMissedFunc(setDeadlineMissedFunc) {
|
deadlineMissedFunc(setDeadlineMissedFunc) {
|
||||||
// It is propably possible to set task priorities by using the native
|
// It is probably possible to set task priorities by using the native
|
||||||
// task handles for Windows / Linux
|
// task handles for Windows / Linux
|
||||||
mainThread = std::thread(&PeriodicTask::taskEntryPoint, this, this);
|
mainThread = std::thread(&PeriodicTask::taskEntryPoint, this, this);
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
@ -184,8 +184,11 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
|
|||||||
strerror(status) << std::endl;
|
strerror(status) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifndef FSFW_USE_REALTIME_FOR_LINUX
|
||||||
// TODO FIFO -> This needs root privileges for the process
|
#error "Please define FSFW_USE_REALTIME_FOR_LINUX with either 0 or 1"
|
||||||
|
#endif
|
||||||
|
#if FSFW_USE_REALTIME_FOR_LINUX == 1
|
||||||
|
// FIFO -> This needs root privileges for the process
|
||||||
status = pthread_attr_setschedpolicy(&attributes,SCHED_FIFO);
|
status = pthread_attr_setschedpolicy(&attributes,SCHED_FIFO);
|
||||||
if(status != 0){
|
if(status != 0){
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
@ -203,7 +206,7 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
|
|||||||
strerror(status) << std::endl;
|
strerror(status) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//Set Signal Mask for suspend until startTask is called
|
//Set Signal Mask for suspend until startTask is called
|
||||||
sigset_t waitSignal;
|
sigset_t waitSignal;
|
||||||
sigemptyset(&waitSignal);
|
sigemptyset(&waitSignal);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user