Mutex improvements #90
No reviewers
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#90
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "KSat/fsfw:mueller_MutexImprovements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #91
implemented returning the right returnvalues,
some form corrections and general improvements.
I am not sure whether a default timeout value which blocks permanently is a good idea..
FreeRTOS Mutex improvementsto Mutex improvementsMutexIF improvements:
and POLLING for polling call which returns immediately
RTEMS is untouched?
I have not set up a RTEMS development environment yet, maybe I should, I heard they have a simulator.. I can make the changes, but I can't test them for RTEMS. However, the itnernal unit tests can be used if RTEMS is set up to check whether everything works immediately.
rtems POLLING and BLOCKING values. I hope those are correct. I did not implement it though.
@ -2,3 +2,3 @@
#include <framework/serviceinterface/ServiceInterfaceStream.h>
const uint32_t MutexIF::NO_TIMEOUT = RTEMS_NO_TIMEOUT;
const uint32_t MutexIF::BLOCKING = RTEMS_NO_TIMEOUT;
Looked through the RTEMS interface and unfortunately this is not correct.
RTEMS_NO_TIMEOUT is only the variable used for the TIMEOUT itself.
The RTEMS rtems_semaphore_obtain uses two different parameters:
Our implementation of lockMutex takes a Timeout. If set to zero this could mean "Lock forever" or "Poll". If we check the value against "MutexIF::POLLING" and "MutexIF::BLOCKING" it is still not clear how long the mutex should be BLOCKING.
I changed it again. But I don't know what rtems_interval is (is it milliseconds)?
I also don't know what the numerical values of those RTEMS constants are so maybe
the implementatio ndoes not work like that.
Hm WAIT is 0 and NO_WAIT is 1. So you can not request a 1 ms wait.
I have an idea for RTEMS. How about encoding POLLING as zero (RTEMS_NO_WAIT) , BLOCKING as 0xffffffff (RTEMS_WAIT with RTEMS_NO_TIMEOUT) and anything between 0 and 0xffffffff is wating with the timeout?
and anything in between is waiting with the timeout, with the value being the timeout?
Pull request has been adapted, MutexIF has slightly different API now and takes type
of timeout as a parameter.