Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ lib/<component>/
- **Time**: use `from time import sleep_ms` (not `utime`, not `sleep()` with float seconds).
- **Exceptions**: use `except Exception:` instead of bare `except:`. Enforced by ruff (E722).
- **No debug `print()`** in production driver code. Enforced by ruff (T20, examples and tests excluded).
- **`@micropython.native`**: do **not** use in driver code (`device.py`) — methods are dominated by I2C/SPI bus time, so native compilation gains nothing and reduces debuggability. In **examples**, it may be used on rendering hot-paths (tight pixel loops, math-heavy drawing functions) where a measurable speedup is expected. Do not apply it to functions with only a few comparisons or I/O calls. Note: the native emitter does not support generators, closures, or `with` statements.

## Driver API conventions

Expand Down
2 changes: 0 additions & 2 deletions lib/vl53l1x/examples/radar_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from time import sleep_ms

import micropython
import ssd1327
from machine import I2C, SPI, Pin
from steami_screen import DARK, GRAY, LIGHT, RED, Screen, SSD1327Display
Expand All @@ -29,7 +28,6 @@
tof = VL53L1X(i2c)


@micropython.native
def compute_display(distance):
"""Compute proximity and color from distance value.

Expand Down
Loading