Skip to content

Commit

Permalink
Merge pull request #501 from markhermelinggt/patch-2
Browse files Browse the repository at this point in the history
xQueuePeek with third parameter '0' does not initialize the 2nd param…
  • Loading branch information
krichardsson authored Nov 7, 2019
2 parents ff3caa8 + 70a7453 commit 24590ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/src/commander.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ void commanderInit(void)
void commanderSetSetpoint(setpoint_t *setpoint, int priority)
{
int currentPriority;
xQueuePeek(priorityQueue, &currentPriority, 0);

if (priority >= currentPriority) {

if (xQueuePeek(priorityQueue, &currentPriority, 0) == pdPass && priority >= currentPriority) {
setpoint->timestamp = xTaskGetTickCount();
// This is a potential race but without effect on functionality
xQueueOverwrite(setpointQueue, setpoint);
Expand Down

0 comments on commit 24590ec

Please sign in to comment.