black
This commit is contained in:
parent
2a22758cf9
commit
68a5881044
2 changed files with 6 additions and 3 deletions
|
|
@ -206,7 +206,9 @@ class Program: # pylint: disable=too-few-public-methods
|
||||||
try:
|
try:
|
||||||
assembled[-1] |= SET_DESTINATIONS.index(instruction[1]) << 5
|
assembled[-1] |= SET_DESTINATIONS.index(instruction[1]) << 5
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
raise ValueError(f"Invalid set destination '{instruction[1]}'") from exc
|
raise ValueError(
|
||||||
|
f"Invalid set destination '{instruction[1]}'"
|
||||||
|
) from exc
|
||||||
value = int(instruction[-1])
|
value = int(instruction[-1])
|
||||||
if not 0 <= value <= 31:
|
if not 0 <= value <= 31:
|
||||||
raise RuntimeError("Set value out of range")
|
raise RuntimeError("Set value out of range")
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ bitloop: ; This loop will run 8 times (8n1 UART)
|
||||||
|
|
||||||
class TXUART:
|
class TXUART:
|
||||||
def __init__(self, *, tx, baudrate=9600):
|
def __init__(self, *, tx, baudrate=9600):
|
||||||
self.pio = rp2pio.StateMachine(code.assembled,
|
self.pio = rp2pio.StateMachine(
|
||||||
|
code.assembled,
|
||||||
first_out_pin=tx,
|
first_out_pin=tx,
|
||||||
first_sideset_pin=tx,
|
first_sideset_pin=tx,
|
||||||
frequency=8 * baudrate,
|
frequency=8 * baudrate,
|
||||||
|
|
@ -33,7 +34,7 @@ class TXUART:
|
||||||
initial_sideset_pin_direction=1,
|
initial_sideset_pin_direction=1,
|
||||||
initial_out_pin_state=1,
|
initial_out_pin_state=1,
|
||||||
initial_out_pin_direction=1,
|
initial_out_pin_direction=1,
|
||||||
**code.pio_kwargs
|
**code.pio_kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue