861fbf6ab5
These files all use decorators (@asm_thumb, @asm_pio) that add names to the function scope, that the linter cannot see. It's useful to clear them in the file not in pyproject.toml as example code will be copied and adapted elsewhere, and those developers may also use Ruff (we hope!) Signed-off-by: Angus Gratton <angus@redyak.com.au>
32 lines
499 B
Python
32 lines
499 B
Python
# Test freezing inline-asm code.
|
|
|
|
# ruff: noqa: F821 - @asm_thumb decorator adds names to function scope
|
|
|
|
import micropython
|
|
|
|
|
|
@micropython.asm_thumb
|
|
def asm_add(r0, r1):
|
|
add(r0, r0, r1)
|
|
|
|
|
|
@micropython.asm_thumb
|
|
def asm_add1(r0) -> object:
|
|
lsl(r0, r0, 1)
|
|
add(r0, r0, 3)
|
|
|
|
|
|
@micropython.asm_thumb
|
|
def asm_cast_bool(r0) -> bool:
|
|
pass
|
|
|
|
|
|
@micropython.asm_thumb
|
|
def asm_shift_int(r0) -> int:
|
|
lsl(r0, r0, 29)
|
|
|
|
|
|
@micropython.asm_thumb
|
|
def asm_shift_uint(r0) -> uint:
|
|
lsl(r0, r0, 29)
|