indentation
This commit is contained in:
parent
5b0758638b
commit
dcb569a7c8
@ -25,10 +25,8 @@
|
|||||||
uint32_t FixedTimeslotTask::deadlineMissedCount = 0;
|
uint32_t FixedTimeslotTask::deadlineMissedCount = 0;
|
||||||
|
|
||||||
FixedTimeslotTask::FixedTimeslotTask(const char *name, rtems_task_priority setPriority,
|
FixedTimeslotTask::FixedTimeslotTask(const char *name, rtems_task_priority setPriority,
|
||||||
size_t setStack, uint32_t setOverallPeriod,
|
size_t setStack, uint32_t setOverallPeriod, void (*setDeadlineMissedFunc)(void)):
|
||||||
void (*setDeadlineMissedFunc)()) :
|
RTEMSTaskBase(setPriority, setStack, name), periodId(0), pst(setOverallPeriod) {
|
||||||
RTEMSTaskBase(setPriority, setStack, name), periodId(0), pst(
|
|
||||||
setOverallPeriod) {
|
|
||||||
// All additional attributes are applied to the object.
|
// All additional attributes are applied to the object.
|
||||||
this->deadlineMissedFunc = setDeadlineMissedFunc;
|
this->deadlineMissedFunc = setDeadlineMissedFunc;
|
||||||
}
|
}
|
||||||
@ -37,10 +35,9 @@ FixedTimeslotTask::~FixedTimeslotTask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtems_task FixedTimeslotTask::taskEntryPoint(rtems_task_argument argument) {
|
rtems_task FixedTimeslotTask::taskEntryPoint(rtems_task_argument argument) {
|
||||||
|
/* The argument is re-interpreted as a FixedTimeslotTask */
|
||||||
//The argument is re-interpreted as PollingTask.
|
|
||||||
FixedTimeslotTask *originalTask(reinterpret_cast<FixedTimeslotTask*>(argument));
|
FixedTimeslotTask *originalTask(reinterpret_cast<FixedTimeslotTask*>(argument));
|
||||||
//The task's functionality is called.
|
/* The task's functionality is called. */
|
||||||
return originalTask->taskFunctionality();
|
return originalTask->taskFunctionality();
|
||||||
/* Should never be reached */
|
/* Should never be reached */
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
@ -73,7 +70,8 @@ ReturnValue_t FixedTimeslotTask::startTask() {
|
|||||||
//ask started successfully
|
//ask started successfully
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
default:
|
default:
|
||||||
/* RTEMS_INVALID_ADDRESS - invalid task entry point
|
/*
|
||||||
|
RTEMS_INVALID_ADDRESS - invalid task entry point
|
||||||
RTEMS_INVALID_ID - invalid task id
|
RTEMS_INVALID_ID - invalid task id
|
||||||
RTEMS_INCORRECT_STATE - task not in the dormant state
|
RTEMS_INCORRECT_STATE - task not in the dormant state
|
||||||
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */
|
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */
|
||||||
@ -118,13 +116,13 @@ void FixedTimeslotTask::taskFunctionality() {
|
|||||||
//The task's "infinite" inner loop is entered.
|
//The task's "infinite" inner loop is entered.
|
||||||
while (1) {
|
while (1) {
|
||||||
if (pst.slotFollowsImmediately()) {
|
if (pst.slotFollowsImmediately()) {
|
||||||
//Do nothing
|
/* Do nothing */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//The interval for the next polling slot is selected.
|
/* The interval for the next polling slot is selected. */
|
||||||
interval = RtemsBasic::convertMsToTicks(this->pst.getIntervalToNextSlotMs());
|
interval = RtemsBasic::convertMsToTicks(this->pst.getIntervalToNextSlotMs());
|
||||||
//The period is checked and restarted with the new interval.
|
/* The period is checked and restarted with the new interval.
|
||||||
//If the deadline was missed, the deadlineMissedFunc is called.
|
If the deadline was missed, the deadlineMissedFunc is called. */
|
||||||
rtems_status_code status = RTEMSTaskBase::restartPeriod(interval,periodId);
|
rtems_status_code status = RTEMSTaskBase::restartPeriod(interval,periodId);
|
||||||
if (status == RTEMS_TIMEOUT) {
|
if (status == RTEMS_TIMEOUT) {
|
||||||
if (this->deadlineMissedFunc != nullptr) {
|
if (this->deadlineMissedFunc != nullptr) {
|
||||||
@ -132,7 +130,7 @@ void FixedTimeslotTask::taskFunctionality() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//The device handler for this slot is executed and the next one is chosen.
|
/* The device handler for this slot is executed and the next one is chosen. */
|
||||||
this->pst.executeAndAdvance();
|
this->pst.executeAndAdvance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user