Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions micropython/aiorepl/aiorepl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# MIT license; Copyright (c) 2022 Jim Mussared

import micropython
from micropython import const
import re
import sys
import time
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/codec/wm8960/wm8960.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def alc_mode(self, channel, mode=ALC_MODE):
)
self.regs[_ALC3] = (_ALC_MODE_MASK, mode << _ALC_MODE_SHIFT)
try:
rate = _alc_sample_rate_table[self.sample_rate]
rate = self._alc_sample_rate_table[self.sample_rate]
except:
rate = 0
self.regs[_ADDCTL3] = (_DACCTL3_ALCSR_MASK, rate)
Expand Down
3 changes: 0 additions & 3 deletions micropython/drivers/imu/bmm150/bmm150.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ def _compensate_z(self, raw, hall):
z = (z5 / (z4 * 4)) / 16
return z

def reset(self):
self._write_reg(_CMD, 0xB6)

def magnet_raw(self):
for i in range(0, 10):
self._read_reg_into(_DATA, self.scratch)
Expand Down
1 change: 1 addition & 0 deletions micropython/drivers/imu/lsm6dsox/lsm6dsox.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

import array
from micropython import const
import time

_CTRL3_C = const(0x12)
_CTRL1_XL = const(0x10)
Expand Down
1 change: 1 addition & 0 deletions micropython/drivers/imu/lsm9ds1/lsm9ds1.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
time.sleep_ms(100)
"""
import array
from micropython import const


_WHO_AM_I = const(0xF)
Expand Down
1 change: 1 addition & 0 deletions micropython/drivers/sensor/lps22h/lps22h.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
time.sleep_ms(10)
"""
import machine
from micropython import const

_LPS22_CTRL_REG1 = const(0x10)
_LPS22_CTRL_REG2 = const(0x11)
Expand Down
1 change: 1 addition & 0 deletions micropython/mip/mip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# MicroPython package installer
# MIT license; Copyright (c) 2022 Jim Mussared

from micropython import const
import requests
import sys

Expand Down
1 change: 1 addition & 0 deletions micropython/net/webrepl/webrepl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This module should be imported from REPL, not run from command line.
import binascii
import hashlib
from micropython import const
import network
import os
import socket
Expand Down
2 changes: 1 addition & 1 deletion micropython/uaiohttpclient/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def print_stream(resp):
print((yield from resp.read()))
return
while True:
line = yield from reader.readline()
line = yield from resp.readline()
if not line:
break
print(line.rstrip())
Expand Down
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ ignore = [
"F403",
"F405",
"F541",
"F821",
"F841",
"ISC003", # micropython does not support implicit concatenation of f-strings
"PIE810", # micropython does not support passing tuples to .startswith or .endswith
Expand Down Expand Up @@ -91,3 +90,10 @@ max-statements = 166

[tool.ruff.per-file-ignores]
"micropython/aiorepl/aiorepl.py" = ["PGH001"]

# manifest.py files are evaluated with some global names pre-defined
"**/manifest.py" = ["F821"]
"ports/**/boards/manifest*.py" = ["F821"]

# ble multitests are evaluated with some names pre-defined
"micropython/bluetooth/aioble/multitests/*" = ["F821"]
4 changes: 2 additions & 2 deletions python-ecosys/cbor2/cbor2/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def decode_simple_value(decoder):

def decode_float16(decoder):
payload = decoder.read(2)
return unpack_float16(payload)
raise NotImplementedError # no float16 unpack function


def decode_float32(decoder):
Expand All @@ -185,7 +185,7 @@ def decode_float64(decoder):
20: lambda self: False,
21: lambda self: True,
22: lambda self: None,
23: lambda self: undefined,
# 23 is undefined
24: decode_simple_value,
25: decode_float16,
26: decode_float32,
Expand Down
2 changes: 2 additions & 0 deletions python-ecosys/iperf3/iperf3.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,11 @@ def client(host, udp=False, reverse=False, bandwidth=10 * 1024 * 1024):
ticks_us_end = param["time"] * 1000000
poll = select.poll()
poll.register(s_ctrl, select.POLLIN)
buf = None
s_data = None
start = None
udp_packet_id = 0
udp_last_send = None
while True:
for pollable in poll.poll(stats.max_dt_ms()):
if pollable_is_sock(pollable, s_data):
Expand Down