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