Skip to content

Commit

Permalink
move cycle conversion macros
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Aug 9, 2023
1 parent 0f6340b commit 530d8a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/core/looptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "driver/time.h"
#include "flight/control.h"

#define US_TO_CYCLES(us) ((us)*TICKS_PER_US)
#define CYCLES_TO_US(cycles) ((cycles) / TICKS_PER_US)

uint8_t looptime_warning = 0;

static uint32_t last_loop_cycles;
Expand Down
3 changes: 3 additions & 0 deletions src/driver/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#define TICKS_PER_US (SYS_CLOCK_FREQ_HZ / 1000000)

#define US_TO_CYCLES(us) ((us)*TICKS_PER_US)
#define CYCLES_TO_US(cycles) ((cycles) / TICKS_PER_US)

void time_init();

uint32_t time_cycles();
Expand Down

0 comments on commit 530d8a2

Please sign in to comment.