top: Update Python formatting to black "2023 stable style".

See https://black.readthedocs.io/en/stable/the_black_code_style/index.html

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2023-02-02 11:51:48 +11:00
parent fe2a8332ff
commit 8b27482692
75 changed files with 208 additions and 123 deletions

View File

@@ -10,7 +10,6 @@ switch = pyb.Switch()
# loop
while True:
# wait for interrupt
# this reduces power consumption while waiting for switch press
pyb.wfi()

View File

@@ -1,6 +1,5 @@
@micropython.asm_thumb
def asm_sum_words(r0, r1):
# r0 = len
# r1 = ptr
# r2 = sum
@@ -25,7 +24,6 @@ def asm_sum_words(r0, r1):
@micropython.asm_thumb
def asm_sum_bytes(r0, r1):
# r0 = len
# r1 = ptr
# r2 = sum

View File

@@ -20,6 +20,7 @@ if hasattr(machine, "Timer"):
else:
_timer = None
# Batch writes into 50ms intervals.
def schedule_in(handler, delay_ms):
def _wrap(_arg):

View File

@@ -4,6 +4,7 @@ import pyb
lcd = pyb.LCD("x")
lcd.light(1)
# do 1 iteration of Conway's Game of Life
def conway_step():
for x in range(128): # loop over x coordinates

View File

@@ -8,6 +8,7 @@ import time
from machine import Pin
import rp2
# Define an empty program that uses a single set pin.
@rp2.asm_pio(set_init=rp2.PIO.OUT_LOW)
def prog():

View File

@@ -33,6 +33,7 @@ for i in range(NUM_UARTS):
sm.active(1)
uarts.append(sm)
# We can print characters from each UART by pushing them to the TX FIFO
def pio_uart_print(sm, s):
for c in s: