Skip to content

Commit

Permalink
couple fixes not yet in official esp-idf
Browse files Browse the repository at this point in the history
- fix i2c crash
- fix usb when enabling wifi

Co-authored-by: Jeff Epler <jepler@gmail.com>
Co-authored-by: Scott Shawcroft <scott@adafruit.com>
  • Loading branch information
3 people committed Jan 25, 2022
1 parent 0b46ac1 commit 2775b6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion components/driver/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,9 @@ static void IRAM_ATTR i2c_master_cmd_begin_static(i2c_port_t i2c_num)
p_i2c->cmd_idx = 0;
if (i2c_cmd_is_single_byte(cmd) || cmd->total_bytes == cmd->bytes_used) {
p_i2c->cmd_link.head = p_i2c->cmd_link.head->next;
p_i2c->cmd_link.head->cmd.bytes_used = 0;
if (p_i2c->cmd_link.head != NULL) {
p_i2c->cmd_link.head->cmd.bytes_used = 0;
}
}
p_i2c->status = I2C_STATUS_WRITE;
break;
Expand Down
2 changes: 1 addition & 1 deletion components/esp_phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ menu "PHY"

config ESP_PHY_ENABLE_USB
bool "Enable USB when phy init"
depends on USB_OTG_SUPPORTED || ESP_CONSOLE_USB_SERIAL_JTAG
depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || ESP_CONSOLE_USB_SERIAL_JTAG
default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
default n
help
Expand Down

2 comments on commit 2775b6e

@dhalbert
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jepler Are these fixes in upstream at all? Should they be PR'd at all? My understanding is that the i2c.c fix is less important now that I am using the I2C wrapper routines, but it still seems like a good idea.

I am asking because I may want to try to fix the minimum-1-second I2C timeout bug as well: adafruit/circuitpython#5908 (comment)

@jepler
Copy link
Member

@jepler jepler commented on 2775b6e Feb 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think upstream would want the i2c fix, so it's good that we changed our code not to need it. I don't know about the other one.

Please sign in to comment.