added dependable build for interface choice in menuconfig

This commit is contained in:
Lurkars
2020-12-17 10:21:10 +01:00
parent 45444bb8c5
commit 7e82c695ea
56 changed files with 483 additions and 522 deletions
-15
View File
@@ -1,15 +0,0 @@
menu "I²C"
config I2C_SDA_PIN
int "I²C sda pin"
default 21
config I2C_SCL_PIN
int "I²C scl pin"
default 22
config I2C_CLOCKSPEED
int "I²C clock speed"
default 1000000
endmenu
+6 -1
View File
@@ -20,9 +20,14 @@
#ifndef _i2c_main_H_
#define _i2c_main_H_
#if defined(CONFIG_ENA_INTERFACE_CUSTOM)
#define I2C_SDA_PIN (CONFIG_I2C_SDA_PIN)
#define I2C_SCL_PIN (CONFIG_I2C_SCL_PIN)
#define I2C_CLK_SPEED (CONFIG_I2C_CLOCKSPEED)
#else
#define I2C_SDA_PIN 21
#define I2C_SCL_PIN 22
#endif
#define I2C_CLK_SPEED (1000000)
/**
* @brief initialize main I2C interface