renormalized line endings
This commit is contained in:
container
ArrayList.hDynamicFIFO.hFIFO.hFIFOBase.hFixedArrayList.hFixedMap.hHybridIterator.hIndexedRingMemoryArray.hPlacementFactory.hRingBufferBase.hSharedRingBuffer.cppSharedRingBuffer.hSimpleRingBuffer.cppSimpleRingBuffer.h
contrib/sgp4
controller
datapool
ControllerSet.cppControllerSet.hHkSwitchHelper.cppHkSwitchHelper.hPoolEntry.cppPoolEntry.hPoolEntryIF.hPoolRawAccessHelper.cppPoolRawAccessHelper.hPoolVarList.h
datapoolglob
DataPoolAdmin.cppDataPoolAdmin.hDataPoolParameterWrapper.cppDataPoolParameterWrapper.hGlobalDataPool.cppGlobalDataPool.hGlobalPoolVariable.hGlobalPoolVector.hPIDReader.hPIDReaderList.hPoolRawAccess.cppPoolRawAccess.h
datapoollocal
devicehandlers
AcceptsDeviceResponsesIF.hAssemblyBase.cppAssemblyBase.hChildHandlerBase.cppChildHandlerBase.hChildHandlerFDIR.cppChildHandlerFDIR.hCommunicationMessage.cppCommunicationMessage.hDeviceCommunicationIF.hDeviceHandlerIF.hDeviceHandlerMessage.cppDeviceHandlerMessage.hDeviceTmReportingWrapper.cppDeviceTmReportingWrapper.hHealthDevice.cppHealthDevice.h
fdir
ConfirmsFailuresIF.hEventCorrelation.cppEventCorrelation.hFailureIsolationBase.cppFailureIsolationBase.hFaultCounter.cppFaultCounter.h
globalfunctions
AsciiConverter.cppAsciiConverter.hCRC.cppDleEncoder.cppDleEncoder.hType.cppType.harrayprinter.cpp
matching
math
timevalOperations.cpphealth
HasHealthIF.hHealthHelper.cppHealthHelper.hHealthMessage.cppHealthMessage.hHealthTable.cppHealthTable.hHealthTableIF.hManagesHealthIF.h
housekeeping
internalError
ipc
CommandMessage.cppCommandMessage.hCommandMessageCleaner.cppCommandMessageCleaner.hCommandMessageIF.hMessageQueueIF.hMessageQueueMessage.cppMessageQueueMessage.hMessageQueueSenderIF.hMutexFactory.hMutexHelper.hMutexIF.hQueueFactory.h
memory
AcceptsMemoryMessagesIF.hFileSystemMessage.cppFileSystemMessage.hHasFileSystemIF.hHasMemoryIF.hMemoryHelper.cppMemoryHelper.hMemoryMessage.cppMemoryMessage.hMemoryProxyIF.h
modes
monitoring
AbsLimitMonitor.hHasMonitorsIF.hLimitMonitor.hLimitViolationReporter.cppLimitViolationReporter.hMonitorBase.hMonitorReporter.hMonitoringIF.hMonitoringMessage.cppMonitoringMessage.hMonitoringMessageContent.hReceivesMonitoringReportsIF.hTriplexMonitor.hTwoValueLimitMonitor.h
objectmanager
osal
FreeRTOS
BinSemaphUsingTask.cppBinSemaphUsingTask.hBinarySemaphore.cppBinarySemaphore.hClock.cppCountingSemaphUsingTask.cppCountingSemaphUsingTask.hCountingSemaphore.cppCountingSemaphore.hFixedTimeslotTask.cppFixedTimeslotTask.hMessageQueue.hMutex.cppMutex.hMutexFactory.cppQueueFactory.cppSemaphoreFactory.cppTaskFactory.cppTaskManagement.cppTaskManagement.hTimekeeper.cppTimekeeper.h
InternalErrorCodes.hhost
Clock.cppFixedTimeslotTask.cppFixedTimeslotTask.hMessageQueue.cppMessageQueue.hMutex.cppMutex.hMutexFactory.cppPeriodicTask.cppPeriodicTask.hQueueFactory.cppQueueMapManager.cppQueueMapManager.hSemaphoreFactory.cppTaskFactory.cpp
linux
BinarySemaphore.cppBinarySemaphore.hClock.cppCountingSemaphore.cppCountingSemaphore.hFixedTimeslotTask.cppFixedTimeslotTask.hInternalErrorCodes.cppMessageQueue.cppMessageQueue.hMutex.cppMutex.hMutexFactory.cppPeriodicPosixTask.cppPeriodicPosixTask.hPosixThread.cppPosixThread.hQueueFactory.cppSemaphoreFactory.cppTaskFactory.cppTcUnixUdpPollingTask.cppTcUnixUdpPollingTask.hTimer.cppTmTcUnixUdpBridge.cppTmTcUnixUdpBridge.h
rtems
parameters
HasParametersIF.hParameterHelper.cppParameterHelper.hParameterMessage.cppParameterMessage.hParameterWrapper.cppParameterWrapper.hReceivesParameterMessagesIF.h
power
Fuse.cppFuse.hPowerComponent.cppPowerComponent.hPowerComponentIF.hPowerSensor.cppPowerSensor.hPowerSwitchIF.hPowerSwitcher.cppPowerSwitcher.h
pus
CService200ModeCommanding.cppCService200ModeCommanding.hCService201HealthCommanding.cppCService201HealthCommanding.hService1TelecommandVerification.cppService1TelecommandVerification.hService2DeviceAccess.cppService2DeviceAccess.hService5EventReporting.cppService5EventReporting.hService8FunctionManagement.cppService8FunctionManagement.h
servicepackets
returnvalues
rmap
RMAP.cppRMAP.hRMAPChannelIF.hRMAPCookie.cppRMAPCookie.hRmapDeviceCommunicationIF.cppRmapDeviceCommunicationIF.h
serialize
EndianConverter.hSerialArrayListAdapter.hSerialBufferAdapter.cppSerialBufferAdapter.hSerialFixedArrayListAdapter.hSerialLinkedListAdapter.hSerializeAdapter.hSerializeElement.hSerializeIF.h
serviceinterface
ServiceInterfaceBuffer.cppServiceInterfaceBuffer.hServiceInterfaceStream.cppServiceInterfaceStream.h
storagemanager
ConstStorageAccessor.cppConstStorageAccessor.hLocalPool.hPoolManager.hStorageAccessor.cppStorageAccessor.hStorageManagerIF.h
subsystem
tasks
ExecutableObjectIF.hFixedSequenceSlot.cppFixedSequenceSlot.hFixedSlotSequence.cppFixedSlotSequence.hFixedTimeslotTaskIF.hPeriodicTaskIF.hSemaphoreFactory.hSemaphoreIF.hTaskFactory.h
tcdistribution
CCSDSDistributor.cppCCSDSDistributor.hCCSDSDistributorIF.hPUSDistributor.cppPUSDistributor.hPUSDistributorIF.hTcDistributor.cppTcDistributor.hTcPacketCheck.cppTcPacketCheck.h
thermal
AbstractTemperatureSensor.cppAbstractTemperatureSensor.hAcceptsThermalMessagesIF.hCoreComponent.hHeater.cppHeater.hRedundantHeater.hTemperatureSensor.hThermalComponentIF.hThermalModule.cppThermalModule.hThermalMonitor.cppThermalMonitor.h
timemanager
CCSDSTime.cppCCSDSTime.hClock.hCountdown.cppCountdown.hReceivesTimeInfoIF.hStopwatch.cppStopwatch.hTimeMessage.cppTimeMessage.hTimeStamperIF.h
tmstorage
tmtcpacket
tmtcservices
AcceptsTelecommandsIF.hAcceptsTelemetryIF.hAcceptsVerifyMessageIF.hCommandingServiceBase.cppCommandingServiceBase.hPusServiceBase.cppPusServiceBase.hPusVerificationReport.cppPusVerificationReport.hSourceSequenceCounter.hTmTcBridge.cppTmTcBridge.hTmTcMessage.cppTmTcMessage.hVerificationReporter.cppVerificationReporter.h
@ -1,87 +1,87 @@
|
||||
/**
|
||||
* @file MultiObjectTask.cpp
|
||||
* @brief This file defines the MultiObjectTask class.
|
||||
* @date 30.01.2014
|
||||
* @author baetz
|
||||
*/
|
||||
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../../tasks/ExecutableObjectIF.h"
|
||||
#include "MultiObjectTask.h"
|
||||
|
||||
MultiObjectTask::MultiObjectTask(const char *name, rtems_task_priority setPriority,
|
||||
size_t setStack, rtems_interval setPeriod, void (*setDeadlineMissedFunc)()) :
|
||||
TaskBase(setPriority, setStack, name), periodTicks(
|
||||
RtemsBasic::convertMsToTicks(setPeriod)), periodId(0), deadlineMissedFunc(
|
||||
setDeadlineMissedFunc) {
|
||||
}
|
||||
|
||||
MultiObjectTask::~MultiObjectTask(void) {
|
||||
//Do not delete objects, we were responsible for ptrs only.
|
||||
rtems_rate_monotonic_delete(periodId);
|
||||
}
|
||||
rtems_task MultiObjectTask::taskEntryPoint(rtems_task_argument argument) {
|
||||
//The argument is re-interpreted as MultiObjectTask. The Task object is global, so it is found from any place.
|
||||
MultiObjectTask *originalTask(reinterpret_cast<MultiObjectTask*>(argument));
|
||||
originalTask->taskFunctionality();
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::startTask() {
|
||||
rtems_status_code status = rtems_task_start(id, MultiObjectTask::taskEntryPoint,
|
||||
rtems_task_argument((void *) this));
|
||||
if (status != RTEMS_SUCCESSFUL) {
|
||||
error << "ObjectTask::startTask for " << std::hex << this->getId()
|
||||
<< std::dec << " failed." << std::endl;
|
||||
}
|
||||
switch(status){
|
||||
case RTEMS_SUCCESSFUL:
|
||||
//ask started successfully
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
default:
|
||||
/* RTEMS_INVALID_ADDRESS - invalid task entry point
|
||||
RTEMS_INVALID_ID - invalid task id
|
||||
RTEMS_INCORRECT_STATE - task not in the dormant state
|
||||
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::sleepFor(uint32_t ms) {
|
||||
return TaskBase::sleepFor(ms);
|
||||
}
|
||||
|
||||
void MultiObjectTask::taskFunctionality() {
|
||||
TaskBase::setAndStartPeriod(periodTicks,&periodId);
|
||||
//The task's "infinite" inner loop is entered.
|
||||
while (1) {
|
||||
for (ObjectList::iterator it = objectList.begin();
|
||||
it != objectList.end(); ++it) {
|
||||
(*it)->performOperation();
|
||||
}
|
||||
rtems_status_code status = TaskBase::restartPeriod(periodTicks,periodId);
|
||||
if (status == RTEMS_TIMEOUT) {
|
||||
char nameSpace[8] = { 0 };
|
||||
char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace),
|
||||
nameSpace);
|
||||
error << "ObjectTask: " << ptr << " Deadline missed." << std::endl;
|
||||
if (this->deadlineMissedFunc != NULL) {
|
||||
this->deadlineMissedFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
|
||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||
object);
|
||||
if (newObject == NULL) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
objectList.push_back(newObject);
|
||||
ReturnValue_t result = newObject->initializeAfterTaskCreation();
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t MultiObjectTask::getPeriodMs() const {
|
||||
return RtemsBasic::convertTicksToMs(periodTicks);
|
||||
}
|
||||
/**
|
||||
* @file MultiObjectTask.cpp
|
||||
* @brief This file defines the MultiObjectTask class.
|
||||
* @date 30.01.2014
|
||||
* @author baetz
|
||||
*/
|
||||
|
||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../../tasks/ExecutableObjectIF.h"
|
||||
#include "MultiObjectTask.h"
|
||||
|
||||
MultiObjectTask::MultiObjectTask(const char *name, rtems_task_priority setPriority,
|
||||
size_t setStack, rtems_interval setPeriod, void (*setDeadlineMissedFunc)()) :
|
||||
TaskBase(setPriority, setStack, name), periodTicks(
|
||||
RtemsBasic::convertMsToTicks(setPeriod)), periodId(0), deadlineMissedFunc(
|
||||
setDeadlineMissedFunc) {
|
||||
}
|
||||
|
||||
MultiObjectTask::~MultiObjectTask(void) {
|
||||
//Do not delete objects, we were responsible for ptrs only.
|
||||
rtems_rate_monotonic_delete(periodId);
|
||||
}
|
||||
rtems_task MultiObjectTask::taskEntryPoint(rtems_task_argument argument) {
|
||||
//The argument is re-interpreted as MultiObjectTask. The Task object is global, so it is found from any place.
|
||||
MultiObjectTask *originalTask(reinterpret_cast<MultiObjectTask*>(argument));
|
||||
originalTask->taskFunctionality();
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::startTask() {
|
||||
rtems_status_code status = rtems_task_start(id, MultiObjectTask::taskEntryPoint,
|
||||
rtems_task_argument((void *) this));
|
||||
if (status != RTEMS_SUCCESSFUL) {
|
||||
error << "ObjectTask::startTask for " << std::hex << this->getId()
|
||||
<< std::dec << " failed." << std::endl;
|
||||
}
|
||||
switch(status){
|
||||
case RTEMS_SUCCESSFUL:
|
||||
//ask started successfully
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
default:
|
||||
/* RTEMS_INVALID_ADDRESS - invalid task entry point
|
||||
RTEMS_INVALID_ID - invalid task id
|
||||
RTEMS_INCORRECT_STATE - task not in the dormant state
|
||||
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::sleepFor(uint32_t ms) {
|
||||
return TaskBase::sleepFor(ms);
|
||||
}
|
||||
|
||||
void MultiObjectTask::taskFunctionality() {
|
||||
TaskBase::setAndStartPeriod(periodTicks,&periodId);
|
||||
//The task's "infinite" inner loop is entered.
|
||||
while (1) {
|
||||
for (ObjectList::iterator it = objectList.begin();
|
||||
it != objectList.end(); ++it) {
|
||||
(*it)->performOperation();
|
||||
}
|
||||
rtems_status_code status = TaskBase::restartPeriod(periodTicks,periodId);
|
||||
if (status == RTEMS_TIMEOUT) {
|
||||
char nameSpace[8] = { 0 };
|
||||
char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace),
|
||||
nameSpace);
|
||||
error << "ObjectTask: " << ptr << " Deadline missed." << std::endl;
|
||||
if (this->deadlineMissedFunc != NULL) {
|
||||
this->deadlineMissedFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t MultiObjectTask::addComponent(object_id_t object) {
|
||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||
object);
|
||||
if (newObject == NULL) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
objectList.push_back(newObject);
|
||||
ReturnValue_t result = newObject->initializeAfterTaskCreation();
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t MultiObjectTask::getPeriodMs() const {
|
||||
return RtemsBasic::convertTicksToMs(periodTicks);
|
||||
}
|
||||
|
Reference in New Issue
Block a user