Skip to content

Commit

Permalink
flight,uavomanager: Misplaced now, wasted ~3% CPU on F3. (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
glowtape authored and mlyle committed May 15, 2018
1 parent 1dc8d72 commit 2637207
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions flight/UAVObjects/uavobjectmanager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,15 +1734,13 @@ static int32_t pumpOneEvent(UAVObjEvent msg, void *obj_data, int len) {
struct ObjectEventEntryThrottled *throtInfo =
(struct ObjectEventEntryThrottled *) event;

uint32_t now = PIOS_Thread_Systime();

if (!PIOS_Thread_Period_Elapsed(throtInfo->when,
throtInfo->interval)) {
continue;
}

// Set time for next callback
throtInfo->when = now;
throtInfo->when = PIOS_Thread_Systime();

if (throtInfo->inhibited) {
continue;
Expand Down

0 comments on commit 2637207

Please sign in to comment.