Fix USE_xxx positions

This commit is contained in:
jflyper 2017-12-11 00:55:06 +09:00
parent bb79830f03
commit 54f5df3ca0
11 changed files with 25 additions and 17 deletions

View File

@ -19,6 +19,9 @@
#include <stdint.h>
#include "platform.h"
#include "common/utils.h"
#ifdef USE_ADC
#include "build/build_config.h"
#include "build/debug.h"
@ -26,11 +29,9 @@
#include "adc.h"
#include "adc_impl.h"
#include "common/utils.h"
//#define DEBUG_ADC_CHANNELS
#ifdef USE_ADC
adcOperatingConfig_t adcOperatingConfig[ADC_CHANNEL_COUNT];
volatile uint16_t adcValues[ADC_CHANNEL_COUNT];

View File

@ -25,6 +25,8 @@
#include "platform.h"
#if defined(USE_I2C) && !defined(SOFT_I2C)
#include "build/build_config.h"
#include "build/debug.h"
@ -35,8 +37,6 @@
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#if defined(USE_I2C) && !defined(SOFT_I2C)
#ifdef I2C_FULL_RECONFIGURABILITY
#if I2CDEV_COUNT >= 1
#ifndef I2C1_SCL

View File

@ -21,6 +21,8 @@
#include <platform.h>
#if defined(USE_I2C) && !defined(SOFT_I2C)
#include "drivers/io.h"
#include "drivers/io_impl.h"
#include "drivers/nvic.h"
@ -30,8 +32,6 @@
#include "drivers/bus_i2c.h"
#include "drivers/bus_i2c_impl.h"
#if defined(USE_I2C) && !defined(SOFT_I2C)
#define CLOCKSPEED 800000 // i2c clockspeed 400kHz default (conform specs), 800kHz and 1200kHz (Betaflight default)
static void i2cUnstick(IO_t scl, IO_t sda);

View File

@ -20,6 +20,8 @@
#include <platform.h>
#ifdef SOFT_I2C
#include "build/build_config.h"
#include "drivers/bus_i2c.h"
@ -28,8 +30,6 @@
// Software I2C driver, using same pins as hardware I2C, with hw i2c module disabled.
// Can be configured for I2C2 pinout (SCL: PB10, SDA: PB11) or I2C1 pinout (SCL: PB6, SDA: PB7)
#ifdef SOFT_I2C
static IO_t scl;
static IO_t sda;
static volatile uint16_t i2cErrorCount = 0;

View File

@ -22,6 +22,8 @@
#include <platform.h>
#if defined(USE_I2C) && !defined(SOFT_I2C)
#include "drivers/io.h"
#include "drivers/time.h"
#include "drivers/nvic.h"
@ -30,8 +32,6 @@
#include "drivers/bus_i2c.h"
#include "drivers/bus_i2c_impl.h"
#if defined(USE_I2C) && !defined(SOFT_I2C)
#define CLOCKSPEED 800000 // i2c clockspeed 400kHz default (conform specs), 800kHz and 1200kHz (Betaflight default)
static void i2c_er_handler(I2CDevice device);

View File

@ -21,6 +21,8 @@
#include <platform.h>
#if defined(USE_I2C) && !defined(SOFT_I2C)
#include "build/debug.h"
#include "drivers/system.h"
@ -31,8 +33,6 @@
#include "drivers/bus_i2c.h"
#include "drivers/bus_i2c_impl.h"
#if defined(USE_I2C) && !defined(SOFT_I2C)
#define IOCFG_I2C_PU IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz, GPIO_OType_OD, GPIO_PuPd_UP)
#define IOCFG_I2C IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz, GPIO_OType_OD, GPIO_PuPd_NOPULL)

View File

@ -20,6 +20,8 @@
#include <platform.h>
#ifdef USE_SPI
#include "drivers/bus_spi.h"
#include "drivers/io.h"
@ -52,3 +54,4 @@ void spiPreInitCsOutPU(ioTag_t iotag)
IOHi(io);
}
}
#endif

View File

@ -21,12 +21,12 @@
#include "platform.h"
#if defined(USE_BUTTONS)
#include "drivers/io.h"
#include "drivers/buttons.h"
#if defined(USE_BUTTONS)
#ifdef BUTTON_A_PIN
static IO_t buttonAPin = IO_NONE;
#endif

View File

@ -4,12 +4,12 @@
#include "platform.h"
#ifdef USE_EXTI
#include "drivers/nvic.h"
#include "io_impl.h"
#include "drivers/exti.h"
#ifdef USE_EXTI
typedef struct {
extiCallbackRec_t* handler;
} extiChannelRec_t;

View File

@ -20,6 +20,8 @@
#include "platform.h"
#ifdef USE_VCP
#include "build/build_config.h"
#include "common/utils.h"
@ -227,3 +229,4 @@ uint32_t usbVcpGetBaudRate(serialPort_t *instance)
return CDC_BaudRate();
}
#endif

View File

@ -20,6 +20,8 @@
#include "platform.h"
#if defined(USE_SONAR)
#include "build/build_config.h"
#include "drivers/exti.h"
@ -37,7 +39,6 @@
*
*/
#if defined(USE_SONAR)
STATIC_UNIT_TESTED volatile int32_t measurement = -1;
static uint32_t lastMeasurementAt;