Skip to content

Commit

Permalink
i2cdetect working as expected with no device
Browse files Browse the repository at this point in the history
- i2cdetect is running without any device on bus
  • Loading branch information
henrykotze committed Oct 8, 2024
1 parent e87543c commit e6adeda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions boards/espressif/esp32/nuttx-config/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CONFIG_DEV_PIPE_SIZE=70
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_ESP32_I2C0=y
CONFIG_ESP32_I2CTIMEOMS=10
CONFIG_ESP32_LEDC=y
CONFIG_ESP32_LEDC_CHANNEL0_PIN=4
CONFIG_ESP32_LEDC_CHANNEL1_PIN=13
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32/src/i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
#include <px4_arch/i2c_hw_description.h>

constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusInternal(0),
initI2CBusInternal(1),
};
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ __BEGIN_DECLS
int px4_esp32_configgpio(uint32_t pinset);
int px4_esp32_unconfiggpio(uint32_t pinset);
int esp32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,bool event, xcpt_t func, void *arg);

#define px4_i2cbus_initialize(bus_num_1based) esp32_i2cbus_initialize(bus_num_1based)
#define px4_i2cbus_uninitialize(pdev) esp32_i2cbus_uninitialize(pdev)

#define PX4_BUS_OFFSET 1
#define px4_arch_configgpio(pinset) px4_esp32_configgpio(pinset)
#define px4_arch_unconfiggpio(pinset) px4_esp32_unconfiggpio(pinset)
#define px4_arch_gpioread(pinset) esp32_gpioread(pinset & GPIO_NUM_MASK)
Expand All @@ -108,9 +105,9 @@ int esp32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,bool e

#define px4_arch_mtd_dev() esp32_spiflash_get_mtd()

#define px4_spibus_initialize(bus_num_1based) esp32_spibus_initialize(bus_num_1based)
#define px4_spibus_initialize(bus_num_1based) esp32_spibus_initialize(PX4_BUS_NUMBER_FROM_PX4(bus_num_1based))

#define px4_i2cbus_initialize(bus_num_1based) esp32_i2cbus_initialize(bus_num_1based)
#define px4_i2cbus_initialize(bus_num_1based) esp32_i2cbus_initialize(PX4_BUS_NUMBER_FROM_PX4(bus_num_1based))
#define px4_i2cbus_uninitialize(pdev) esp32_i2cbus_uninitialize(pdev)

#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_UNUSED
Expand Down

0 comments on commit e6adeda

Please sign in to comment.