diff --git a/examples/asmled.py b/examples/asmled.py index 09a06c184ade..4ff35dfdf8d0 100644 --- a/examples/asmled.py +++ b/examples/asmled.py @@ -1,5 +1,9 @@ # flash LED #1 using inline assembler # this version is overly verbose and uses word stores +# +# ruff: noqa: F821 - @asm_thumb decorator adds names to function scope + + @micropython.asm_thumb def flash_led(r0): movw(r1, (stm.GPIOA + stm.GPIO_BSRRL) & 0xFFFF) diff --git a/examples/asmsum.py b/examples/asmsum.py index f2c7f285badc..2d8c2b2c9984 100644 --- a/examples/asmsum.py +++ b/examples/asmsum.py @@ -1,3 +1,6 @@ +# ruff: noqa: F821 - @asm_thumb decorator adds names to function scope + + @micropython.asm_thumb def asm_sum_words(r0, r1): # r0 = len diff --git a/examples/natmod/btree/btree_py.py b/examples/natmod/btree/btree_py.py index bd53c084a13b..461b045c98df 100644 --- a/examples/natmod/btree/btree_py.py +++ b/examples/natmod/btree/btree_py.py @@ -1,3 +1,7 @@ # Implemented in Python to support keyword arguments + +# ruff: noqa: F821 - this file is evaluated with C-defined names in scope + + def open(stream, *, flags=0, cachesize=0, pagesize=0, minkeypage=0): return _open(stream, flags, cachesize, pagesize, minkeypage) diff --git a/examples/natmod/features2/test.py b/examples/natmod/features2/test.py index 5ac80120d733..af79b9692c21 100644 --- a/examples/natmod/features2/test.py +++ b/examples/natmod/features2/test.py @@ -1,5 +1,7 @@ # This Python code will be merged with the C code in main.c +# ruff: noqa: F821 - this file is evaluated with C-defined names in scope + import array diff --git a/examples/rp2/pio_1hz.py b/examples/rp2/pio_1hz.py index 84d761fa1434..3ffab79d5623 100644 --- a/examples/rp2/pio_1hz.py +++ b/examples/rp2/pio_1hz.py @@ -1,6 +1,8 @@ # Example using PIO to blink an LED and raise an IRQ at 1Hz. # Note: this does not work on Pico W because it uses Pin(25) for LED output. +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import time from machine import Pin import rp2 diff --git a/examples/rp2/pio_exec.py b/examples/rp2/pio_exec.py index ce39f2df8430..3bea51f8dd49 100644 --- a/examples/rp2/pio_exec.py +++ b/examples/rp2/pio_exec.py @@ -5,6 +5,8 @@ # - using set_init and set_base # - using StateMachine.exec +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import time from machine import Pin import rp2 diff --git a/examples/rp2/pio_pinchange.py b/examples/rp2/pio_pinchange.py index 767c8e78c2ee..4a210e7f390f 100644 --- a/examples/rp2/pio_pinchange.py +++ b/examples/rp2/pio_pinchange.py @@ -8,6 +8,8 @@ # - setting an irq handler for a StateMachine # - instantiating 2x StateMachine's with the same program and different pins +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import time from machine import Pin import rp2 diff --git a/examples/rp2/pio_pwm.py b/examples/rp2/pio_pwm.py index 176a238091a5..24fd6b85a302 100644 --- a/examples/rp2/pio_pwm.py +++ b/examples/rp2/pio_pwm.py @@ -1,5 +1,7 @@ # Example of using PIO for PWM, and fading the brightness of an LED +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + from machine import Pin from rp2 import PIO, StateMachine, asm_pio from time import sleep diff --git a/examples/rp2/pio_uart_rx.py b/examples/rp2/pio_uart_rx.py index 080b6bd6392b..f46aaa6a5e38 100644 --- a/examples/rp2/pio_uart_rx.py +++ b/examples/rp2/pio_uart_rx.py @@ -8,6 +8,8 @@ # - PIO irq handler # - using the second core via _thread +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import _thread from machine import Pin, UART from rp2 import PIO, StateMachine, asm_pio diff --git a/examples/rp2/pio_uart_tx.py b/examples/rp2/pio_uart_tx.py index 5e4af8f6ccfd..04abf2d0d150 100644 --- a/examples/rp2/pio_uart_tx.py +++ b/examples/rp2/pio_uart_tx.py @@ -1,5 +1,7 @@ # Example using PIO to create a UART TX interface +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + from machine import Pin from rp2 import PIO, StateMachine, asm_pio diff --git a/examples/rp2/pio_ws2812.py b/examples/rp2/pio_ws2812.py index dd021a9d5642..6de21ab8b7a2 100644 --- a/examples/rp2/pio_ws2812.py +++ b/examples/rp2/pio_ws2812.py @@ -1,5 +1,7 @@ # Example using PIO to drive a set of WS2812 LEDs. +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import array, time from machine import Pin import rp2 diff --git a/examples/rp2/pwm_fade.py b/examples/rp2/pwm_fade.py index 5b7089c6b1ad..6672f3443f3b 100644 --- a/examples/rp2/pwm_fade.py +++ b/examples/rp2/pwm_fade.py @@ -1,6 +1,8 @@ # Example using PWM to fade an LED. # Note: this does not work on Pico W because it uses Pin(25) for LED output. +# ruff: noqa: F821 - @asm_pio decorator adds names to function scope + import time from machine import Pin, PWM diff --git a/ports/qemu-arm/test-frzmpy/frozen_asm.py b/ports/qemu-arm/test-frzmpy/frozen_asm.py index 2c7f5c92cd37..ba43264b389e 100644 --- a/ports/qemu-arm/test-frzmpy/frozen_asm.py +++ b/ports/qemu-arm/test-frzmpy/frozen_asm.py @@ -1,5 +1,7 @@ # Test freezing inline-asm code. +# ruff: noqa: F821 - @asm_thumb decorator adds names to function scope + import micropython