linux changes adapted

This commit is contained in:
Robin Müller 2020-12-14 21:54:03 +01:00
parent f2ba653833
commit 3ee25785a2
9 changed files with 26 additions and 24 deletions

View File

@ -1,4 +1,4 @@
#include "../../osal/linux/BinarySemaphore.h"
#include "BinarySemaphore.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
extern "C" {

View File

@ -1,4 +1,3 @@
#include <fsfw/timemanager/Stopwatch.h>
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include "../../timemanager/Clock.h"
@ -86,15 +85,16 @@ ReturnValue_t Clock::getUptime(timeval* uptime) {
return HasReturnvaluesIF::RETURN_OK;
}
uint32_t Clock::getUptimeSeconds() {
//TODO This is not posix compatible and delivers only seconds precision
struct sysinfo sysInfo;
int result = sysinfo(&sysInfo);
if(result != 0){
return HasReturnvaluesIF::RETURN_FAILED;
}
return sysInfo.uptime;
}
// Wait for new FSFW Clock function delivering seconds uptime.
//uint32_t Clock::getUptimeSeconds() {
// //TODO This is not posix compatible and delivers only seconds precision
// struct sysinfo sysInfo;
// int result = sysinfo(&sysInfo);
// if(result != 0){
// return HasReturnvaluesIF::RETURN_FAILED;
// }
// return sysInfo.uptime;
//}
ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) {
timeval uptime;

View File

@ -1,4 +1,4 @@
#include "../../osal/linux/Mutex.h"
#include "Mutex.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include "../../timemanager/Clock.h"

View File

@ -1,12 +1,8 @@
#ifndef OS_LINUX_MUTEX_H_
#define OS_LINUX_MUTEX_H_
#ifndef FSFW_OSAL_LINUX_MUTEX_H_
#define FSFW_OSAL_LINUX_MUTEX_H_
#include "../../ipc/MutexIF.h"
extern "C" {
#include <pthread.h>
}
class Mutex : public MutexIF {
public:

View File

@ -1,5 +1,6 @@
#include "Mutex.h"
#include "../../ipc/MutexFactory.h"
#include "../../osal/linux/Mutex.h"
//TODO: Different variant than the lazy loading in QueueFactory. What's better and why?
MutexFactory* MutexFactory::factoryInstance = new MutexFactory();

View File

@ -1,5 +1,7 @@
#include "PosixThread.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include "../../osal/linux/PosixThread.h"
#include <cstring>
#include <errno.h>

View File

@ -1,6 +1,7 @@
#include "../../tasks/SemaphoreFactory.h"
#include "BinarySemaphore.h"
#include "CountingSemaphore.h"
#include "../../tasks/SemaphoreFactory.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;

View File

@ -1,5 +1,6 @@
#include "../../osal/linux/FixedTimeslotTask.h"
#include "../../osal/linux/PeriodicPosixTask.h"
#include "FixedTimeslotTask.h"
#include "PeriodicPosixTask.h"
#include "../../tasks/TaskFactory.h"
#include "../../returnvalues/HasReturnvaluesIF.h"

View File

@ -1,6 +1,7 @@
#include "Timer.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include <errno.h>
#include "../../osal/linux/Timer.h"
Timer::Timer() {
sigevent sigEvent;