summaryrefslogtreecommitdiff
path: root/examples/rp2
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2023-08-09 18:14:33 +1000
committerDamien George <damien@micropython.org>2023-08-16 16:12:33 +1000
commit861fbf6ab5bb0c2a21a04a312453bb7adb92b8be (patch)
tree4ffea27e65f9a78c42bc04e6341892fcb91c6587 /examples/rp2
parent00855eeb36acaf626f153d8c1850ca75744b1c55 (diff)
examples: Mark asm, pio, etc. as noqa: F821 (undefined-name).
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>
Diffstat (limited to 'examples/rp2')
-rw-r--r--examples/rp2/pio_1hz.py2
-rw-r--r--examples/rp2/pio_exec.py2
-rw-r--r--examples/rp2/pio_pinchange.py2
-rw-r--r--examples/rp2/pio_pwm.py2
-rw-r--r--examples/rp2/pio_uart_rx.py2
-rw-r--r--examples/rp2/pio_uart_tx.py2
-rw-r--r--examples/rp2/pio_ws2812.py2
-rw-r--r--examples/rp2/pwm_fade.py2
8 files changed, 16 insertions, 0 deletions
diff --git a/examples/rp2/pio_1hz.py b/examples/rp2/pio_1hz.py
index 84d761fa1..3ffab79d5 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 ce39f2df8..3bea51f8d 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 767c8e78c..4a210e7f3 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 176a23809..24fd6b85a 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 080b6bd63..f46aaa6a5 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 5e4af8f6c..04abf2d0d 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 dd021a9d5..6de21ab8b 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 5b7089c6b..6672f3443 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