From 9f55608f928c4280230a8cabfe8afdece1f92a83 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Sat, 23 Oct 2021 13:28:40 +0000 Subject: [PATCH] Correct limit for PIOBuilder::out_pins count argument This value is written to the PINCTRL register field OUT_COUNT, which accoding to the data sheet has a valid range of 0-32. Fixes #181 --- rp2040-hal/src/pio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rp2040-hal/src/pio.rs b/rp2040-hal/src/pio.rs index c65ed7d..986370a 100644 --- a/rp2040-hal/src/pio.rs +++ b/rp2040-hal/src/pio.rs @@ -1174,7 +1174,7 @@ impl PIOBuilder

{ /// The least-significant bit of `OUT` instruction asserts the state of the pin indicated by `base`, the next bit /// asserts the state of the next pin, and so on up to `count` pins. The pin numbers are considered modulo 32. pub fn out_pins(mut self, base: u8, count: u8) -> Self { - assert!(count <= 5); + assert!(count <= 32); self.out_base = base; self.out_count = count; self