1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-20 14:55:18 +03:00

Split time declarations out of system.h into time.h

This commit is contained in:
Martin Budden 2017-02-07 13:15:45 +00:00
parent 5c2f2f9af3
commit 5fcd222cc7
127 changed files with 158 additions and 121 deletions

View file

@ -45,7 +45,7 @@
#include "drivers/pwm_rx.h"
#include "drivers/sensor.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/controlrate_profile.h"

View file

@ -38,7 +38,7 @@
#include "drivers/gpio.h"
#include "drivers/sensor.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/serial.h"
#include "drivers/compass.h"
#include "drivers/timer.h"

View file

@ -43,6 +43,7 @@
#include "common/typeconversion.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/rc_controls.h"

View file

@ -36,7 +36,7 @@
#include "config/feature.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"

View file

@ -30,7 +30,7 @@
#include "build/version.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "cms/cms.h"
#include "cms/cms_types.h"

View file

@ -21,6 +21,7 @@
#include <platform.h>
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "common/maths.h"

View file

@ -24,7 +24,7 @@
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "bus_spi.h"

View file

@ -27,7 +27,7 @@
#include "common/maths.h"
#include "common/axis.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "bus_i2c.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "bus_i2c.h"

View file

@ -31,6 +31,7 @@
#include "nvic.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "exti.h"
#include "bus_i2c.h"

View file

@ -23,6 +23,7 @@
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "exti.h"
#include "bus_i2c.h"

View file

@ -28,7 +28,7 @@
#include "nvic.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "exti.h"
#include "bus_i2c.h"

View file

@ -25,6 +25,7 @@
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "exti.h"
#include "gpio.h"
#include "gyro_sync.h"

View file

@ -31,6 +31,7 @@
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "exti.h"
#include "bus_spi.h"

View file

@ -24,6 +24,7 @@
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "exti.h"
#include "io.h"
#include "bus_spi.h"

View file

@ -36,6 +36,7 @@
#include "io.h"
#include "system.h"
#include "time.h"
#include "exti.h"
#include "bus_spi.h"
#include "gyro_sync.h"

View file

@ -23,7 +23,7 @@
#include "build/build_config.h"
#include "build/debug.h"
#include "system.h"
#include "time.h"
#include "adc.h"
#include "adc_impl.h"

View file

@ -25,7 +25,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#include "sensor.h"
#include "accgyro.h"
#include "adc.h"

View file

@ -20,7 +20,7 @@
#include <string.h>
#include "platform.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "sensor.h"

View file

@ -20,7 +20,7 @@
#include <string.h>
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "io_impl.h"

View file

@ -20,7 +20,7 @@
#include <string.h>
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "io_impl.h"

View file

@ -25,7 +25,7 @@
#include "barometer.h"
#include "gpio.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "nvic.h"
#include "exti.h"

View file

@ -24,7 +24,7 @@
#include "barometer.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "barometer_bmp280.h"

View file

@ -25,7 +25,7 @@
#include "barometer.h"
#include "barometer_spi_ms5611.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
// MS5611, Standard address 0x77

View file

@ -21,7 +21,7 @@
#include <platform.h>
#include "io.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "nvic.h"

View file

@ -24,7 +24,7 @@
#include "build/atomic.h"
#include "io.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "nvic.h"

View file

@ -20,7 +20,7 @@
#include <platform.h>
#include "system.h"
#include "time.h"
#include "io.h"
#include "io_impl.h"
#include "rcc.h"

View file

@ -31,7 +31,7 @@
#include "common/maths.h"
#include "common/utils.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "bus_spi.h"

View file

@ -30,7 +30,7 @@
#include "common/maths.h"
#include "common/utils.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "bus_i2c.h"

View file

@ -29,7 +29,7 @@
#include "common/axis.h"
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "nvic.h"
#include "io.h"
#include "exti.h"

View file

@ -29,7 +29,7 @@
#include "common/axis.h"
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "nvic.h"
#include "io.h"
#include "exti.h"

View file

@ -30,7 +30,7 @@
#include "common/axis.h"
#include "common/maths.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "bus_i2c.h"

View file

@ -21,7 +21,7 @@
#include "platform.h"
#include "bus_i2c.h"
#include "system.h"
#include "time.h"
#include "display_ug2864hsweg01.h"

View file

@ -25,7 +25,7 @@
#include "flash_m25p16.h"
#include "io.h"
#include "bus_spi.h"
#include "system.h"
#include "time.h"
#define M25P16_INSTRUCTION_RDID 0x9F
#define M25P16_INSTRUCTION_READ_BYTES 0x03

View file

@ -26,7 +26,7 @@
#include "gps_i2cnav.h"
#include "gpio.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#ifndef GPS_I2C_INSTANCE

View file

@ -4,7 +4,7 @@
#include <platform.h>
#include "gpio.h"
#include "system.h"
#include "time.h"
#include "bus_i2c.h"
#include "common/maths.h"

View file

@ -23,7 +23,7 @@
#include "common/utils.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "light_led.h"

View file

@ -27,7 +27,7 @@
#include "nvic.h"
#include "dma.h"
#include "io.h"
#include "system.h"
#include "time.h"
#include "rcc.h"
#include "timer.h"

View file

@ -27,7 +27,7 @@
#include "nvic.h"
#include "dma.h"
#include "io.h"
#include "system.h"
#include "time.h"
#include "rcc.h"
#include "timer.h"

View file

@ -27,7 +27,7 @@
#ifdef BOOTLOG
#include "system.h"
#include "time.h"
static bootLogEntry_t events[MAX_BOOTLOG_ENTRIES];
static int eventCount;

View file

@ -30,7 +30,7 @@
#include "drivers/bus_spi.h"
#include "drivers/light_led.h"
#include "drivers/io.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/nvic.h"
#include "drivers/dma.h"

View file

@ -22,7 +22,7 @@
#include "bus_i2c.h"
#include "pitotmeter.h"
#include "system.h"
#include "time.h"
#include "common/utils.h"

View file

@ -27,7 +27,7 @@
#include "common/utils.h"
#include "system.h"
#include "time.h"
#include "nvic.h"
#include "io.h"

View file

@ -28,7 +28,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "io.h"
#include "io_impl.h"

View file

@ -28,7 +28,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "io.h"
#include "io_impl.h"

View file

@ -27,7 +27,7 @@
#include "dma.h"
#include "bus_spi.h"
#include "system.h"
#include "time.h"
#include "sdcard.h"
#include "sdcard_standard.h"

View file

@ -28,7 +28,7 @@
#include "common/utils.h"
#include "nvic.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "timer.h"

View file

@ -27,7 +27,7 @@
#include <platform.h>
#include "system.h"
#include "time.h"
#include "io.h"
#include "nvic.h"
#include "dma.h"

View file

@ -28,7 +28,7 @@
#include <platform.h>
#include "system.h"
#include "time.h"
#include "io.h"
#include "nvic.h"
#include "dma.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "rcc.h"
#include "nvic.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "rcc.h"
#include "nvic.h"

View file

@ -37,7 +37,7 @@ USBD_HandleTypeDef USBD_Device;
#include "hw_config.h"
#endif
#include "system.h"
#include "time.h"
#include "serial.h"
#include "serial_usb_vcp.h"

View file

@ -25,7 +25,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#include "exti.h"
#include "io.h"
#include "gpio.h"

View file

@ -25,7 +25,7 @@
#include "build/build_config.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/bus_i2c.h"
#include "drivers/rangefinder.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "system.h"
#include "time.h"
#include "io.h"
#include "sound_beeper.h"

View file

@ -24,7 +24,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#include "gpio.h"
#include "sound_beeper.h"

View file

@ -28,6 +28,7 @@
#include "build/build_config.h"
#include "system.h"
#include "time.h"
#ifndef EXTI_CALLBACK_HANDLER_COUNT
#define EXTI_CALLBACK_HANDLER_COUNT 1

View file

@ -20,18 +20,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "common/time.h"
void systemInit(void);
void delayMicroseconds(timeUs_t us);
void delay(timeMs_t ms);
timeUs_t micros(void);
timeUs_t microsISR(void);
timeMs_t millis(void);
uint32_t ticks(void);
timeDelta_t ticks_diff_us(uint32_t begin, uint32_t end);
typedef enum {
FAILURE_DEVELOPER = 0,

32
src/main/drivers/time.h Normal file
View file

@ -0,0 +1,32 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include "common/time.h"
void delayMicroseconds(timeUs_t us);
void delay(timeMs_t ms);
timeUs_t micros(void);
timeUs_t microsISR(void);
timeMs_t millis(void);
uint32_t ticks(void);
timeDelta_t ticks_diff_us(uint32_t begin, uint32_t end);

View file

@ -29,7 +29,7 @@
#include "io.h"
#include "rcc.h"
#include "system.h"
#include "time.h"
#include "timer.h"
#include "timer_impl.h"

View file

@ -29,7 +29,7 @@
#include "io.h"
#include "rcc.h"
#include "system.h"
#include "time.h"
#include "timer.h"
#include "timer_impl.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "io.h"
#include "system.h"
#include "time.h"
static IO_t usbDetectPin = IO_NONE;

View file

@ -23,7 +23,7 @@
#ifdef USB_IO
#include "io.h"
#include "system.h"
#include "time.h"
#include "usb_io.h"
#include "sdcard.h"

View file

@ -63,6 +63,7 @@ extern uint8_t __config_end;
#include "drivers/serial.h"
#include "drivers/stack_check.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/timer.h"
#include "fc/cli.h"

View file

@ -34,7 +34,7 @@
#include "drivers/light_led.h"
#include "drivers/gyro_sync.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "sensors/sensors.h"
#include "sensors/diagnostics.h"

View file

@ -21,7 +21,7 @@
#include "platform.h"
#include "drivers/light_led.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/fc_init.h"

View file

@ -38,7 +38,7 @@
#include "drivers/logging.h"
#include "drivers/nvic.h"
#include "drivers/sensor.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/dma.h"
#include "drivers/exti.h"
#include "drivers/gpio.h"
@ -49,6 +49,7 @@
#include "drivers/serial.h"
#include "drivers/serial_softserial.h"
#include "drivers/serial_uart.h"
#include "drivers/system.h"
#include "drivers/accgyro.h"
#include "drivers/compass.h"
#include "drivers/pwm_mapping.h"

View file

@ -41,6 +41,7 @@
#include "drivers/sdcard.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/controlrate_profile.h"

View file

@ -32,7 +32,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/controlrate_profile.h"

View file

@ -33,7 +33,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/controlrate_profile.h"

View file

@ -30,7 +30,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "io/beeper.h"

View file

@ -32,7 +32,7 @@
#include "common/maths.h"
#include "common/filter.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "sensors/sensors.h"
#include "sensors/acceleration.h"

View file

@ -36,7 +36,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/runtime_config.h"

View file

@ -32,7 +32,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/pwm_output.h"
#include "drivers/pwm_mapping.h"

View file

@ -38,7 +38,7 @@
#include "drivers/pwm_output.h"
#include "drivers/pwm_mapping.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "io/gimbal.h"

View file

@ -24,7 +24,7 @@
#include "common/utils.h"
#include "drivers/sound_beeper.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "sensors/battery.h"
#include "sensors/sensors.h"

View file

@ -27,7 +27,7 @@
#include "build/version.h"
#include "build/build_config.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/display_ug2864hsweg01.h"
#include "cms/cms.h"

View file

@ -27,7 +27,7 @@
#include "common/utils.h"
#include "drivers/display.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/fc_msp.h"

View file

@ -39,6 +39,7 @@
#include "drivers/light_led.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "sensors/sensors.h"
#include "sensors/compass.h"

View file

@ -33,7 +33,7 @@
#include "drivers/gps_i2cnav.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/runtime_config.h"

View file

@ -35,7 +35,7 @@
#include "common/utils.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/runtime_config.h"

View file

@ -34,7 +34,7 @@
#include "common/utils.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/runtime_config.h"

View file

@ -37,7 +37,7 @@
#include "common/utils.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/runtime_config.h"

View file

@ -40,7 +40,7 @@
#include "drivers/light_ws2811strip.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/rc_controls.h"

View file

@ -54,7 +54,7 @@
#include "drivers/display.h"
#include "drivers/max7456.h"
#include "drivers/max7456_symbols.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "io/displayport_max7456.h"
#include "io/flashfs.h"

View file

@ -30,6 +30,7 @@
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/serial.h"
#if defined(USE_SOFTSERIAL1) || defined(USE_SOFTSERIAL2)
#include "drivers/serial_softserial.h"

View file

@ -34,7 +34,7 @@
#include "drivers/pwm_mapping.h"
#include "drivers/pwm_output.h"
#include "drivers/light_led.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "flight/mixer.h"
#include "io/beeper.h"
#include "io/serial_4way.h"

View file

@ -27,7 +27,7 @@
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
#include "common/utils.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/serial.h"
#include "drivers/buf_writer.h"
#include "drivers/pwm_mapping.h"

View file

@ -31,7 +31,7 @@
#include "drivers/buf_writer.h"
#include "drivers/pwm_mapping.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"

View file

@ -20,7 +20,7 @@
#include "platform.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/light_led.h"
#include "statusindicator.h"

View file

@ -32,7 +32,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/rc_controls.h"

View file

@ -30,7 +30,7 @@
#include "common/maths.h"
#include "common/filter.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "sensors/sensors.h"
#include "sensors/acceleration.h"

View file

@ -32,7 +32,7 @@
#include "config/feature.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/sensor.h"
#include "drivers/accgyro.h"

View file

@ -26,7 +26,7 @@
#include "build/build_config.h"
#include "build/debug.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "common/axis.h"
#include "common/maths.h"

View file

@ -33,7 +33,7 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "fc/config.h"
#include "fc/rc_controls.h"

View file

@ -30,7 +30,7 @@
#include "common/maths.h"
#include "common/utils.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "drivers/serial.h"
#include "drivers/serial_uart.h"

View file

@ -34,7 +34,7 @@
#include "common/utils.h"
#include "drivers/serial.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "io/serial.h"

View file

@ -49,7 +49,7 @@
#include "drivers/serial.h"
#include "drivers/serial_uart.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "io/serial.h"

View file

@ -30,7 +30,7 @@
#include "drivers/rx_nrf24l01.h"
#include "drivers/rx_xn297.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "rx/rx.h"
#include "rx/rx_spi.h"

View file

@ -32,7 +32,7 @@
#include "drivers/rx_nrf24l01.h"
#include "drivers/rx_xn297.h"
#include "drivers/system.h"
#include "drivers/time.h"
#include "rx/rx.h"
#include "rx/rx_spi.h"

Some files were not shown because too many files have changed in this diff Show more