Make it 'flashable'
This commit is contained in:
parent
793eb33f67
commit
f11a189e31
4 changed files with 25 additions and 6 deletions
|
@ -16,16 +16,28 @@
|
|||
/* --------- ESP8266 I2C init (note: clk_stretch_tick field) --------- */
|
||||
static void i2c_init(void)
|
||||
{
|
||||
// i2c_config_t conf = {
|
||||
// .mode = I2C_MODE_MASTER,
|
||||
// .sda_io_num = I2C_SDA_PIN,
|
||||
// .scl_io_num = I2C_SCL_PIN,
|
||||
// .sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
// .scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
// .clk_stretch_tick = 300, // reasonable default on ESP8266
|
||||
// };
|
||||
// i2c_param_config(I2C_PORT, &conf);
|
||||
// i2c_driver_install(I2C_PORT, conf.mode); // ESP8266 signature: (port, mode)
|
||||
|
||||
i2c_config_t conf = {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = I2C_SDA_PIN,
|
||||
.scl_io_num = I2C_SCL_PIN,
|
||||
.sda_io_num = GPIO_NUM_0,
|
||||
.scl_io_num = GPIO_NUM_2,
|
||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.clk_stretch_tick = 300, // reasonable default on ESP8266
|
||||
.clk_stretch_tick = 300, // try 300..1000
|
||||
};
|
||||
i2c_param_config(I2C_PORT, &conf);
|
||||
i2c_driver_install(I2C_PORT, conf.mode); // ESP8266 signature: (port, mode)
|
||||
|
||||
ESP_ERROR_CHECK(i2c_param_config(I2C_PORT, &conf));
|
||||
ESP_ERROR_CHECK(i2c_driver_install(I2C_PORT, conf.mode));
|
||||
}
|
||||
|
||||
/* ------------- BME68x I2C read/write helpers ------------- */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue