Skip to content

Commit

Permalink
all: Remove unnecessary start argument in range.
Browse files Browse the repository at this point in the history
To satisfy Ruff.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Aug 31, 2023
1 parent 7fcc728 commit e6b89ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions micropython/drivers/imu/bmi270/bmi270.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,15 +598,15 @@ def _write_reg(self, reg, val):
def _write_burst(self, reg, data, chunk=16):
self._write_reg(_INIT_ADDR_0, 0)
self._write_reg(_INIT_ADDR_1, 0)
for i in range(0, len(data) // chunk):
for i in range(len(data) // chunk):
offs = i * chunk
self._write_reg(reg, data[offs : offs + chunk])
init_addr = ((i + 1) * chunk) // 2
self._write_reg(_INIT_ADDR_0, (init_addr & 0x0F))
self._write_reg(_INIT_ADDR_1, (init_addr >> 4) & 0xFF)

def _poll_reg(self, reg, mask, retry=10, delay=100):
for i in range(0, retry):
for i in range(retry):
if self._read_reg(reg) & mask:
return True
time.sleep_ms(delay)
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/bmm150/bmm150.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _compensate_z(self, raw, hall):
return z

def magnet_raw(self):
for i in range(0, 10):
for i in range(10):
self._read_reg_into(_DATA, self.scratch)
if self.scratch[3] & 0x1:
return (
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/lsm6dsox/lsm6dsox.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _read_reg_into(self, reg, buf):

def reset(self):
self._write_reg(_CTRL3_C, self._read_reg(_CTRL3_C) | 0x1)
for i in range(0, 10):
for i in range(10):
if (self._read_reg(_CTRL3_C) & 0x01) == 0:
return
time.sleep_ms(10)
Expand Down
2 changes: 1 addition & 1 deletion micropython/espflash/espflash.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _write_reg(self, addr, data, mask=0xFFFFFFFF, delay=0):
raise Exception("Command ESP_WRITE_REG failed.")

def _poll_reg(self, addr, flag, retry=10, delay=0.050):
for i in range(0, retry):
for i in range(retry):
reg = self._read_reg(addr)
if (reg & flag) == 0:
break
Expand Down

0 comments on commit e6b89ea

Please sign in to comment.