From 15bb0aee985cc5b558cea21e635b1600db5905f5 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 29 Aug 2020 19:08:10 +0200 Subject: [PATCH] handler ID cached, debug output improved --- osal/FreeRTOS/FixedTimeslotTask.cpp | 13 +++++++++---- tasks/FixedSequenceSlot.cpp | 2 +- tasks/FixedSequenceSlot.h | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/osal/FreeRTOS/FixedTimeslotTask.cpp b/osal/FreeRTOS/FixedTimeslotTask.cpp index 404c3c05..309574eb 100644 --- a/osal/FreeRTOS/FixedTimeslotTask.cpp +++ b/osal/FreeRTOS/FixedTimeslotTask.cpp @@ -147,13 +147,18 @@ void FixedTimeslotTask::checkMissedDeadline(const TickType_t xLastWakeTime, } void FixedTimeslotTask::handleMissedDeadline() { -#ifdef DEBUG - sif::warning << "FixedTimeslotTask: " << pcTaskGetName(NULL) << - " missed deadline!\n" << std::flush; -#endif if(deadlineMissedFunc != nullptr) { this->deadlineMissedFunc(); } + +#ifdef DEBUG + object_id_t handlerId = pst.current->handlerId; + sif::warning << "FixedTimeslotTask: " << pcTaskGetName(NULL) << " with" + << " object ID 0x" << std::setfill('0') << std::setw(8) << std::hex + << handlerId << " missed deadline!" << std::setfill(' ') + << std::dec << std::endl; +#endif + } ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) { diff --git a/tasks/FixedSequenceSlot.cpp b/tasks/FixedSequenceSlot.cpp index a38734a2..d7aeff0a 100644 --- a/tasks/FixedSequenceSlot.cpp +++ b/tasks/FixedSequenceSlot.cpp @@ -4,7 +4,7 @@ FixedSequenceSlot::FixedSequenceSlot(object_id_t handlerId, uint32_t setTime, int8_t setSequenceId, ExecutableObjectIF* executableObject, - PeriodicTaskIF* executingTask) : + PeriodicTaskIF* executingTask) : handlerId(handlerId), pollingTimeMs(setTime), opcode(setSequenceId) { if(executableObject == nullptr) { return; diff --git a/tasks/FixedSequenceSlot.h b/tasks/FixedSequenceSlot.h index 6ec9ae13..151173e9 100644 --- a/tasks/FixedSequenceSlot.h +++ b/tasks/FixedSequenceSlot.h @@ -20,6 +20,8 @@ public: PeriodicTaskIF* executingTask); virtual ~FixedSequenceSlot(); + object_id_t handlerId; + /** * @brief Handler identifies which object is executed in this slot. */