Skip to content

Commit

Permalink
Only start scheduler with a valid role
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Dec 18, 2023
1 parent d8eae8f commit 358b16c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions software/firmware/src/tasks/ranging/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ schedule_role_t scheduler_get_current_role(void)

void scheduler_run(schedule_role_t role, uint32_t timestamp)
{
// Ensure that the role is a valid ranging role
if ((role != ROLE_MASTER) && (role != ROLE_PARTICIPANT))
return;

// Wake up the DW3000 ranging radio and set it to the correct channel
ranging_radio_wakeup();
ranging_radio_choose_channel(RADIO_XMIT_CHANNEL);
Expand Down

0 comments on commit 358b16c

Please sign in to comment.