mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
Configurable I2C (rework)
This commit is contained in:
parent
a72f98e4f3
commit
52bfef1ea5
39 changed files with 1195 additions and 384 deletions
|
@ -34,6 +34,7 @@
|
|||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "drivers/adc.h"
|
||||
#include "drivers/bus.h"
|
||||
#include "drivers/bus_i2c.h"
|
||||
#include "drivers/bus_spi.h"
|
||||
#include "drivers/dma.h"
|
||||
|
@ -92,10 +93,6 @@
|
|||
void targetPreInit(void);
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_BUS_INIT
|
||||
void targetBusInit(void);
|
||||
#endif
|
||||
|
||||
uint8_t systemState = SYSTEM_STATE_INITIALISING;
|
||||
|
||||
void processLoopback(void)
|
||||
|
@ -195,6 +192,11 @@ void init(void)
|
|||
#endif /* USE_SPI */
|
||||
|
||||
#ifdef USE_I2C
|
||||
i2cHardwareConfigure();
|
||||
|
||||
// Note: Unlike UARTs which are configured when client is present,
|
||||
// I2C buses are initialized unconditionally if they are configured.
|
||||
|
||||
#ifdef USE_I2C_DEVICE_1
|
||||
i2cInit(I2CDEV_1);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue