Revised LPF1+LPF2 filter cutoff bandwidths from STMicro (#13239)
[betaflight.git] / src / main / common / stopwatch.h
blob765b3e4831132a9215fdd5c33eae65bebe4633cc
1 /*
2 * This file is part of Betaflight.
4 * Betaflight is free software. You can redistribute this software
5 * and/or modify this software under the terms of the GNU General
6 * Public License as published by the Free Software Foundation,
7 * either version 3 of the License, or (at your option) any later
8 * version.
10 * Betaflight is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this software.
19 * If not, see <http://www.gnu.org/licenses/>.
22 #pragma once
24 #include <stdbool.h>
25 #include <stdint.h>
27 typedef struct stopwatch_s {
28 bool isRunning;
29 uint32_t start;
30 uint32_t stop;
31 uint32_t elapsed;
32 } stopwatch_t;
34 void stopwatchInit(stopwatch_t *watch);
35 void stopwatchReset(stopwatch_t *watch);
36 uint32_t stopwatchStart(stopwatch_t *watch);
37 uint32_t stopwatchStop(stopwatch_t *watch);
38 uint32_t stopwatchGetCycles(stopwatch_t *watch);
39 uint32_t stopwatchGetMicros(stopwatch_t *watch);
40 float stopwatchGetMicrosf(stopwatch_t *watch);