Skip to content

Commit 430e258

Browse files
Merge branch 'micropython:master' into patch-1
2 parents 6b5c60b + 567540d commit 430e258

File tree

75 files changed

+474
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+474
-133
lines changed

.github/workflows/build_packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: vars.MICROPY_PUBLISH_MIP_INDEX && github.event_name == 'push' && ! github.event.deleted
2424
run: source tools/ci.sh && ci_push_package_index
2525
- name: Upload packages as artifact
26-
uses: actions/upload-artifact@v3
26+
uses: actions/upload-artifact@v4
2727
with:
2828
name: packages-${{ github.sha }}
2929
path: ${{ env.PACKAGE_INDEX_PATH }}

.github/workflows/ruff.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
9-
- run: pip install --user ruff==0.1.2
9+
# Version should be kept in sync with .pre-commit_config.yaml & also micropython
10+
- run: pip install --user ruff==0.11.6
1011
- run: ruff check --output-format=github .
1112
- run: ruff format --diff .

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ repos:
88
verbose: true
99
stages: [commit-msg]
1010
- repo: https://github.com/charliermarsh/ruff-pre-commit
11-
rev: v0.1.2
11+
# Version should be kept in sync with .github/workflows/ruff.yml & also micropython
12+
rev: v0.11.6
1213
hooks:
1314
- id: ruff
1415
id: ruff-format

micropython/aioespnow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ A small async server example::
5555
import asyncio
5656

5757
# A WLAN interface must be active to send()/recv()
58-
network.WLAN(network.STA_IF).active(True)
58+
network.WLAN(network.WLAN.IF_STA).active(True)
5959

6060
e = aioespnow.AIOESPNow() # Returns AIOESPNow enhanced with async support
6161
e.active(True)

micropython/aiorepl/aiorepl.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async def task(g=None, prompt="--> "):
132132
continue
133133
if curs:
134134
# move cursor to end of the line
135-
sys.stdout.write("\x1B[{}C".format(curs))
135+
sys.stdout.write("\x1b[{}C".format(curs))
136136
curs = 0
137137
sys.stdout.write("\n")
138138
if cmd:
@@ -153,10 +153,10 @@ async def task(g=None, prompt="--> "):
153153
if curs:
154154
cmd = "".join((cmd[: -curs - 1], cmd[-curs:]))
155155
sys.stdout.write(
156-
"\x08\x1B[K"
156+
"\x08\x1b[K"
157157
) # move cursor back, erase to end of line
158158
sys.stdout.write(cmd[-curs:]) # redraw line
159-
sys.stdout.write("\x1B[{}D".format(curs)) # reset cursor location
159+
sys.stdout.write("\x1b[{}D".format(curs)) # reset cursor location
160160
else:
161161
cmd = cmd[:-1]
162162
sys.stdout.write("\x08 \x08")
@@ -207,21 +207,21 @@ async def task(g=None, prompt="--> "):
207207
elif key == "[D": # left
208208
if curs < len(cmd) - 1:
209209
curs += 1
210-
sys.stdout.write("\x1B")
210+
sys.stdout.write("\x1b")
211211
sys.stdout.write(key)
212212
elif key == "[C": # right
213213
if curs:
214214
curs -= 1
215-
sys.stdout.write("\x1B")
215+
sys.stdout.write("\x1b")
216216
sys.stdout.write(key)
217217
elif key == "[H": # home
218218
pcurs = curs
219219
curs = len(cmd)
220-
sys.stdout.write("\x1B[{}D".format(curs - pcurs)) # move cursor left
220+
sys.stdout.write("\x1b[{}D".format(curs - pcurs)) # move cursor left
221221
elif key == "[F": # end
222222
pcurs = curs
223223
curs = 0
224-
sys.stdout.write("\x1B[{}C".format(pcurs)) # move cursor right
224+
sys.stdout.write("\x1b[{}C".format(pcurs)) # move cursor right
225225
else:
226226
# sys.stdout.write("\\x")
227227
# sys.stdout.write(hex(c))
@@ -231,7 +231,7 @@ async def task(g=None, prompt="--> "):
231231
# inserting into middle of line
232232
cmd = "".join((cmd[:-curs], b, cmd[-curs:]))
233233
sys.stdout.write(cmd[-curs - 1 :]) # redraw line to end
234-
sys.stdout.write("\x1B[{}D".format(curs)) # reset cursor location
234+
sys.stdout.write("\x1b[{}D".format(curs)) # reset cursor location
235235
else:
236236
sys.stdout.write(b)
237237
cmd += b

micropython/bluetooth/aioble-central/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
metadata(version="0.2.2")
1+
metadata(version="0.3.0")
22

33
require("aioble-core")
44

micropython/bluetooth/aioble-core/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
metadata(version="0.3.0")
1+
metadata(version="0.4.0")
22

33
package(
44
"aioble",

micropython/bluetooth/aioble/aioble/central.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ async def _cancel_pending():
104104

105105
# Start connecting to a peripheral.
106106
# Call device.connect() rather than using method directly.
107-
async def _connect(connection, timeout_ms):
107+
async def _connect(
108+
connection, timeout_ms, scan_duration_ms, min_conn_interval_us, max_conn_interval_us
109+
):
108110
device = connection.device
109111
if device in _connecting:
110112
return
@@ -122,7 +124,13 @@ async def _connect(connection, timeout_ms):
122124

123125
try:
124126
with DeviceTimeout(None, timeout_ms):
125-
ble.gap_connect(device.addr_type, device.addr)
127+
ble.gap_connect(
128+
device.addr_type,
129+
device.addr,
130+
scan_duration_ms,
131+
min_conn_interval_us,
132+
max_conn_interval_us,
133+
)
126134

127135
# Wait for the connected IRQ.
128136
await connection._event.wait()

micropython/bluetooth/aioble/aioble/device.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,26 @@ def __str__(self):
132132
def addr_hex(self):
133133
return binascii.hexlify(self.addr, ":").decode()
134134

135-
async def connect(self, timeout_ms=10000):
135+
async def connect(
136+
self,
137+
timeout_ms=10000,
138+
scan_duration_ms=None,
139+
min_conn_interval_us=None,
140+
max_conn_interval_us=None,
141+
):
136142
if self._connection:
137143
return self._connection
138144

139145
# Forward to implementation in central.py.
140146
from .central import _connect
141147

142-
await _connect(DeviceConnection(self), timeout_ms)
148+
await _connect(
149+
DeviceConnection(self),
150+
timeout_ms,
151+
scan_duration_ms,
152+
min_conn_interval_us,
153+
max_conn_interval_us,
154+
)
143155

144156
# Start the device task that will clean up after disconnection.
145157
self._connection._run_task()

micropython/bluetooth/aioble/examples/l2cap_file_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def download(self, path, dest):
8888

8989
await self._command(_COMMAND_SEND, path.encode())
9090

91-
with open(dest, "wb") as f: # noqa: ASYNC101
91+
with open(dest, "wb") as f: # noqa: ASYNC230
9292
total = 0
9393
buf = bytearray(self._channel.our_mtu)
9494
mv = memoryview(buf)

0 commit comments

Comments
 (0)