ADD answer question 1

This commit is contained in:
fastium 2024-12-31 14:41:16 +01:00
parent f64b8bdd9a
commit 957860b2ff
2 changed files with 25 additions and 10 deletions

View File

@ -84,6 +84,21 @@ We observe a light usage of 1% of CPU. The CPU is now sleeping all the time and
We notice, that we miss such less event when is event driven (or not at all). But with a static scheduling the response time is still long because the reset task is call with a certain period. We notice, that we miss such less event when is event driven (or not at all). But with a static scheduling the response time is still long because the reset task is call with a certain period.
# Multi-tasking
## Question 1
We have computed the elapsed time between the event is sent by the interruption until it is executed :
|Rtos priority |time |
|---|---|
|osPriorityBelowNormal |13 usecs |
|osPriorityNormal |13 usecs |
|osPriorityAboveNormal |13 usecs |
To abtain these values, we have to consider that there is a isr thread. He dispatchs all the events from the gear device and the reset device. The rest is processed by the main thread.
Main of the time, it meares these values. But sometimes, higher values can appear. These values doesn't change because there isn't often more than one event in the queue.
# Issues # Issues
When compile with GCC, the full loop of static scheduling is 2 to 3 ms faster than expected. When compile with GCC, the full loop of static scheduling is 2 to 3 ms faster than expected.
This problem doesn't occur if we compile with ARMC6. This problem doesn't occur if we compile with ARMC6.

View File

@ -66,7 +66,7 @@ BikeSystem::BikeSystem()
_resetDevice(callback(this, &BikeSystem::onReset)), _resetDevice(callback(this, &BikeSystem::onReset)),
_speedometer(_timer), _speedometer(_timer),
_cpuLogger(_timer), _cpuLogger(_timer),
_isrEventThread(osPriorityNormal, OS_STACK_SIZE, nullptr, "ISR_Event") {} _isrEventThread(osPriorityAboveNormal, OS_STACK_SIZE, nullptr, "ISR_Event") {}
void BikeSystem::start() { void BikeSystem::start() {
tr_info("Starting Super-Loop with event handling"); tr_info("Starting Super-Loop with event handling");
@ -144,7 +144,7 @@ void BikeSystem::init() {
} }
// enable/disable task logging // enable/disable task logging
_taskLogger.enable(true); _taskLogger.enable(false);
} }
void BikeSystem::gearUpTask() { void BikeSystem::gearUpTask() {