Updated include guards

This commit is contained in:
Steffen Gaisser 2020-11-17 19:35:37 +01:00
parent 273ddf9061
commit 6489246c4b
12 changed files with 31 additions and 41 deletions

View File

@ -3,7 +3,7 @@
#include <rtems/score/todimpl.h>
uint16_t Clock::leapSeconds = 0;
MutexIF* Clock::timeMutex = NULL;
MutexIF* Clock::timeMutex = nullptr;
uint32_t Clock::getTicksPerSecond(void){
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
@ -40,7 +40,7 @@ ReturnValue_t Clock::setClock(const timeval* time) {
//SHOULDDO: Not sure if we need to protect this call somehow (by thread lock or something).
//Uli: rtems docu says you can call this from an ISR, not sure if this means no protetion needed
//TODO Second parameter is ISR_lock_Context
_TOD_Set(&newTime,NULL);
_TOD_Set(&newTime,nullptr);
return HasReturnvaluesIF::RETURN_OK;
}
@ -131,7 +131,7 @@ ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) {
ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) {
//SHOULDDO: works not for dates in the past (might have less leap seconds)
if (timeMutex == NULL) {
if (timeMutex == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
@ -167,7 +167,7 @@ ReturnValue_t Clock::setLeapSeconds(const uint16_t leapSeconds_) {
}
ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) {
if(timeMutex==NULL){
if(timeMutex==nullptr){
return HasReturnvaluesIF::RETURN_FAILED;
}
MutexHelper helper(timeMutex);
@ -178,13 +178,13 @@ ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) {
}
ReturnValue_t Clock::checkOrCreateClockMutex(){
if(timeMutex==NULL){
if(timeMutex==nullptr){
MutexFactory* mutexFactory = MutexFactory::instance();
if (mutexFactory == NULL) {
if (mutexFactory == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
timeMutex = mutexFactory->createMutex();
if (timeMutex == NULL) {
if (timeMutex == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
}

View File

@ -4,7 +4,7 @@
#include "RtemsBasic.h"
#include <cstring>
MessageQueue::MessageQueue(size_t message_depth, size_t max_message_size) :
id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(NULL) {
id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(nullptr) {
rtems_name name = ('Q' << 24) + (queueCounter++ << 8);
rtems_status_code status = rtems_message_queue_create(name, message_depth,
max_message_size, 0, &(this->id));
@ -91,11 +91,11 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
//TODO: Check if we're in ISR.
if (result != RTEMS_SUCCESSFUL && !ignoreFault) {
if (internalErrorReporter == NULL) {
if (internalErrorReporter == nullptr) {
internalErrorReporter = objectManager->get<InternalErrorReporterIF>(
objects::INTERNAL_ERROR_REPORTER);
}
if (internalErrorReporter != NULL) {
if (internalErrorReporter != nullptr) {
internalErrorReporter->queueMessageNotSent();
}
}

View File

@ -1,14 +1,5 @@
/**
* @file MessageQueue.h
*
* @date 10/02/2012
* @author Bastian Baetz
*
* @brief This file contains the definition of the MessageQueue class.
*/
#ifndef MESSAGEQUEUE_H_
#define MESSAGEQUEUE_H_
#ifndef FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_
#define FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_
#include "../../internalError/InternalErrorReporterIF.h"
#include "../../ipc/MessageQueueIF.h"
@ -178,4 +169,4 @@ private:
static ReturnValue_t convertReturnCode(rtems_status_code inValue);
};
#endif /* MESSAGEQUEUE_H_ */
#endif /* FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_ */

View File

@ -64,7 +64,7 @@ void MultiObjectTask::taskFunctionality() {
char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace),
nameSpace);
sif::error << "ObjectTask: " << ptr << " Deadline missed." << std::endl;
if (this->deadlineMissedFunc != NULL) {
if (this->deadlineMissedFunc != nullptr) {
this->deadlineMissedFunc();
}
}
@ -74,7 +74,7 @@ void MultiObjectTask::taskFunctionality() {
ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
object);
if (newObject == NULL) {
if (newObject == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
objectList.push_back(newObject);

View File

@ -80,7 +80,7 @@ protected:
/**
* @brief The pointer to the deadline-missed function.
* @details This pointer stores the function that is executed if the task's deadline is missed.
* So, each may react individually on a timing failure. The pointer may be NULL,
* So, each may react individually on a timing failure. The pointer may be nullptr,
* then nothing happens on missing the deadline. The deadline is equal to the next execution
* of the periodic task.
*/

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_OSAL_RTEMS_MUTEX_H_
#define FRAMEWORK_OSAL_RTEMS_MUTEX_H_
#ifndef FSFW_OSAL_RTEMS_MUTEX_H_
#define FSFW_OSAL_RTEMS_MUTEX_H_
#include "../../ipc/MutexIF.h"
#include "RtemsBasic.h"
@ -15,4 +15,4 @@ private:
static uint8_t count;
};
#endif /* OS_RTEMS_MUTEX_H_ */
#endif /* FSFW_OSAL_RTEMS_MUTEX_H_ */

View File

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

View File

@ -108,7 +108,7 @@ void PollingTask::taskFunctionality() {
//If the deadline was missed, the deadlineMissedFunc is called.
rtems_status_code status = TaskBase::restartPeriod(interval,periodId);
if (status == RTEMS_TIMEOUT) {
if (this->deadlineMissedFunc != NULL) {
if (this->deadlineMissedFunc != nullptr) {
this->deadlineMissedFunc();
}
}

View File

@ -1,5 +1,5 @@
#ifndef POLLINGTASK_H_
#define POLLINGTASK_H_
#ifndef FSFW_OSAL_RTEMS_POLLINGTASK_H_
#define FSFW_OSAL_RTEMS_POLLINGTASK_H_
#include "../../tasks/FixedSlotSequence.h"
#include "../../tasks/FixedTimeslotTaskIF.h"
@ -82,4 +82,4 @@ protected:
void taskFunctionality( void );
};
#endif /* POLLINGTASK_H_ */
#endif /* FSFW_OSAL_RTEMS_POLLINGTASK_H_ */

View File

@ -3,7 +3,7 @@
#include "MessageQueue.h"
#include "RtemsBasic.h"
QueueFactory* QueueFactory::factoryInstance = NULL;
QueueFactory* QueueFactory::factoryInstance = nullptr;
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
@ -38,7 +38,7 @@ ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
}
QueueFactory* QueueFactory::instance() {
if (factoryInstance == NULL) {
if (factoryInstance == nullptr) {
factoryInstance = new QueueFactory;
}
return factoryInstance;

View File

@ -1,5 +1,5 @@
#ifndef OS_RTEMS_RTEMSBASIC_H_
#define OS_RTEMS_RTEMSBASIC_H_
#ifndef FSFW_OSAL_RTEMS_RTEMSBASIC_H_
#define FSFW_OSAL_RTEMS_RTEMSBASIC_H_
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <rtems.h>
@ -22,4 +22,4 @@ public:
}
};
#endif /* OS_RTEMS_RTEMSBASIC_H_ */
#endif /* FSFW_OSAL_RTEMS_RTEMSBASIC_H_ */

View File

@ -1,5 +1,5 @@
#ifndef TASKBASE_H_
#define TASKBASE_H_
#ifndef FSFW_OSAL_RTEMS_TASKBASE_H_
#define FSFW_OSAL_RTEMS_TASKBASE_H_
#include "RtemsBasic.h"
#include "../../tasks/PeriodicTaskIF.h"
@ -44,4 +44,4 @@ private:
};
#endif /* TASKBASE_H_ */
#endif /* FSFW_OSAL_RTEMS_TASKBASE_H_ */