Update i2c/spi drivers so they do not include "board.h". It is now clear

what all i2c/spi drivers need to compile and what was unnecessarily
included
before.

Renamed printf_config.h into build_config.h, move SOFT_I2C toggle switch
to build_config.h.
This commit is contained in:
Dominic Clifton 2014-04-17 12:06:32 +01:00
parent ff0f4e66a9
commit 1205765b4c
8 changed files with 33 additions and 9 deletions

View File

@ -150,8 +150,6 @@ typedef void (* pidControllerFuncPtr)(void); // pid controller fu
#define BEEP_ON ; #define BEEP_ON ;
#endif #endif
#undef SOFT_I2C // enable to test software i2c
#include "boardalignment.h" #include "boardalignment.h"
#include "battery.h" #include "battery.h"
#include "math.h" #include "math.h"

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
//#define SOFT_I2C // enable to test software i2c
#ifndef __CC_ARM #ifndef __CC_ARM
#define USE_LAME_PRINTF #define USE_LAME_PRINTF
#define PRINTF_LONG_SUPPORT #define PRINTF_LONG_SUPPORT

View File

@ -1,4 +1,14 @@
#include "board.h" #include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#include "build_config.h"
#include "gpio_common.h"
#include "system_common.h"
#include "bus_i2c.h"
#ifndef SOFT_I2C #ifndef SOFT_I2C

View File

@ -1,4 +1,11 @@
#include "board.h" #include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#include "build_config.h"
#include "gpio_common.h"
// Software I2C driver, using same pins as hardware I2C, with hw i2c module disabled. // Software I2C driver, using same pins as hardware I2C, with hw i2c module disabled.
// SCL PB10 // SCL PB10

View File

@ -1,4 +1,11 @@
#include "board.h" #include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#include "gpio_common.h"
#include "bus_spi.h"
// SPI2 Driver // SPI2 Driver
// PB15 28 SPI2_MOSI // PB15 28 SPI2_MOSI

View File

@ -9,7 +9,6 @@
#define U_ID_1 (*(uint32_t*)0x1FFFF7EC) #define U_ID_1 (*(uint32_t*)0x1FFFF7EC)
#define U_ID_2 (*(uint32_t*)0x1FFFF7F0) #define U_ID_2 (*(uint32_t*)0x1FFFF7F0)
// Hardware definitions and GPIO // Hardware definitions and GPIO
#ifdef FY90Q #ifdef FY90Q
// FY90Q // FY90Q

View File

@ -34,11 +34,11 @@
#include <stdarg.h> #include <stdarg.h>
#include "build_config.h"
#include "drivers/serial_common.h" #include "drivers/serial_common.h"
#include "runtime_config.h" #include "runtime_config.h"
#include "printf_config.h"
#include "printf.h" #include "printf.h"
#ifdef PRINTF_LONG_SUPPORT #ifdef PRINTF_LONG_SUPPORT

View File

@ -1,7 +1,8 @@
#include "board.h" #include "board.h"
#include "mw.h" #include "mw.h"
#include "printf_config.h" #include "build_config.h"
#ifdef PRINTF_LONG_SUPPORT #ifdef PRINTF_LONG_SUPPORT
void uli2a(unsigned long int num, unsigned int base, int uc, char *bf) void uli2a(unsigned long int num, unsigned int base, int uc, char *bf)