Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
12b6ff67
Commit
12b6ff67
authored
1 year ago
by
Niccolò Betto
Committed by
Davide Mor
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[EventBroker] Update to Miosix 2.7 API
parent
75c309d2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/events/EventBroker.cpp
+5
-8
5 additions, 8 deletions
src/shared/events/EventBroker.cpp
src/shared/events/EventBroker.h
+0
-1
0 additions, 1 deletion
src/shared/events/EventBroker.h
with
5 additions
and
9 deletions
src/shared/events/EventBroker.cpp
+
5
−
8
View file @
12b6ff67
...
@@ -66,11 +66,8 @@ uint16_t EventBroker::postDelayed(const Event& ev, uint8_t topic,
...
@@ -66,11 +66,8 @@ uint16_t EventBroker::postDelayed(const Event& ev, uint8_t topic,
Lock
<
FastMutex
>
lock
(
mtxDelayedEvents
);
Lock
<
FastMutex
>
lock
(
mtxDelayedEvents
);
// Delay in system ticks
DelayedEvent
dev
{
eventCounter
++
,
ev
,
topic
,
long
long
delayTicks
=
miosix
::
getTime
()
+
delayMs
*
Constants
::
NS_IN_MS
};
static_cast
<
long
long
>
(
delayMs
*
miosix
::
TICK_FREQ
/
1000
);
DelayedEvent
dev
{
eventCounter
++
,
ev
,
topic
,
getTick
()
+
delayTicks
};
bool
added
=
false
;
bool
added
=
false
;
// Add the new event in the list, ordered by deadline (first = nearest
// Add the new event in the list, ordered by deadline (first = nearest
...
@@ -141,7 +138,7 @@ void EventBroker::run()
...
@@ -141,7 +138,7 @@ void EventBroker::run()
while
(
!
shouldStop
())
while
(
!
shouldStop
())
{
{
while
(
delayedEvents
.
size
()
>
0
&&
while
(
delayedEvents
.
size
()
>
0
&&
delayedEvents
.
front
().
deadline
<=
getTi
ck
())
delayedEvents
.
front
().
deadline
<=
miosix
::
getTi
me
())
{
{
// Pop the first element
// Pop the first element
DelayedEvent
dev
=
delayedEvents
.
front
();
DelayedEvent
dev
=
delayedEvents
.
front
();
...
@@ -157,7 +154,7 @@ void EventBroker::run()
...
@@ -157,7 +154,7 @@ void EventBroker::run()
// When to wakeup for the next cycle
// When to wakeup for the next cycle
long
long
sleepUntil
=
long
long
sleepUntil
=
getTi
ck
()
+
EVENT_BROKER_MIN_DELAY
*
miosix
::
TICK_FREQ
/
1000
;
miosix
::
getTi
me
()
+
EVENT_BROKER_MIN_DELAY
*
Constants
::
NS_IN_MS
;
if
(
delayedEvents
.
size
()
>
0
)
if
(
delayedEvents
.
size
()
>
0
)
{
{
...
@@ -173,7 +170,7 @@ void EventBroker::run()
...
@@ -173,7 +170,7 @@ void EventBroker::run()
Unlock
<
FastMutex
>
unlock
(
lock
);
Unlock
<
FastMutex
>
unlock
(
lock
);
StackLogger
::
getInstance
().
updateStack
(
THID_EVT_BROKER
);
StackLogger
::
getInstance
().
updateStack
(
THID_EVT_BROKER
);
Thread
::
s
leepUntil
(
sleepUntil
);
Thread
::
nanoS
leepUntil
(
sleepUntil
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/shared/events/EventBroker.h
+
0
−
1
View file @
12b6ff67
...
@@ -39,7 +39,6 @@ using std::map;
...
@@ -39,7 +39,6 @@ using std::map;
using
std
::
vector
;
using
std
::
vector
;
using
miosix
::
FastMutex
;
using
miosix
::
FastMutex
;
using
miosix
::
getTick
;
using
miosix
::
Lock
;
using
miosix
::
Lock
;
using
miosix
::
Thread
;
using
miosix
::
Thread
;
using
miosix
::
Unlock
;
using
miosix
::
Unlock
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment