Skip to content

Commit 8b099ac

Browse files
Add patches
1 parent 325270b commit 8b099ac

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

patches/fix_mpremote.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/tools/mpremote/mpremote/main.py b/tools/mpremote/mpremote/main.py
2+
index b30a1a213..015a31114 100644
3+
--- a/tools/mpremote/mpremote/main.py
4+
+++ b/tools/mpremote/mpremote/main.py
5+
@@ -508,7 +508,7 @@ class State:
6+
self.ensure_connected()
7+
soft_reset = self._auto_soft_reset if soft_reset is None else soft_reset
8+
if soft_reset or not self.transport.in_raw_repl:
9+
- self.transport.enter_raw_repl(soft_reset=soft_reset)
10+
+ self.transport.enter_raw_repl(soft_reset=False)
11+
self._auto_soft_reset = False
12+
13+
def ensure_friendly_repl(self):
14+
diff --git a/tools/mpremote/mpremote/transport_serial.py b/tools/mpremote/mpremote/transport_serial.py
15+
index 6aed0bb49..b74bb68a0 100644
16+
--- a/tools/mpremote/mpremote/transport_serial.py
17+
+++ b/tools/mpremote/mpremote/transport_serial.py
18+
@@ -139,7 +139,7 @@ class SerialTransport(Transport):
19+
time.sleep(0.01)
20+
return data
21+
22+
- def enter_raw_repl(self, soft_reset=True, timeout_overall=10):
23+
+ def enter_raw_repl(self, soft_reset=False, timeout_overall=10):
24+
self.serial.write(b"\r\x03") # ctrl-C: interrupt any running program
25+
26+
# flush input (without relying on serial.flushInput())
27+

patches/i2c_ng.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- lib/esp-idf/components/driver/i2c/i2c.c.orig 2025-11-23 11:54:37.321320078 +0100
2+
+++ lib/esp-idf/components/driver/i2c/i2c.c 2025-11-23 11:54:54.681590547 +0100
3+
@@ -1715,8 +1715,8 @@
4+
// So if the new I2C driver is not linked in, then `i2c_acquire_bus_handle()` should be NULL at runtime.
5+
extern __attribute__((weak)) esp_err_t i2c_acquire_bus_handle(int port_num, void *i2c_new_bus, int mode);
6+
if ((void *)i2c_acquire_bus_handle != NULL) {
7+
- ESP_EARLY_LOGE(I2C_TAG, "CONFLICT! driver_ng is not allowed to be used with this old driver");
8+
- abort();
9+
+ ESP_EARLY_LOGE(I2C_TAG, "CONFLICT! driver_ng is not allowed to be used with this old driver BUT abort is disabled!");
10+
+ //abort();
11+
}
12+
ESP_EARLY_LOGW(I2C_TAG, "This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`");
13+
}

0 commit comments

Comments
 (0)