diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-11-28 21:47:17 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-11-28 21:47:17 +0100 |
commit | 91910f8045317d8b7fd91c6ad090433d0434cd7d (patch) | |
tree | 1c4f80ab7f0858835a7790d6b28ce04ad64c0c40 /src/arch/posix/driver | |
parent | 7c52c7ea67f6e9633ca43315176f3f303ae868ad (diff) |
posix: configurable i2c bus
Diffstat (limited to 'src/arch/posix/driver')
-rw-r--r-- | src/arch/posix/driver/i2c.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/posix/driver/i2c.cc b/src/arch/posix/driver/i2c.cc index b408320..4cfdd35 100644 --- a/src/arch/posix/driver/i2c.cc +++ b/src/arch/posix/driver/i2c.cc @@ -13,6 +13,9 @@ #include <linux/i2c-dev.h> #include <i2c/smbus.h> +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) +#define I2C_BUS TOSTRING(CONFIG_arch_posix_driver_i2c_bus) signed char I2C::setup() { @@ -57,4 +60,4 @@ signed char I2C::xmit(unsigned char address, return 0; } -I2C i2c("/dev/i2c-1"); +I2C i2c(I2C_BUS); |