From 622431c6b595cdba5e68116c57c9566757298070 Mon Sep 17 00:00:00 2001 From: Stephen Hensley Date: Thu, 25 Jun 2026 09:15:30 -0700 Subject: [PATCH] remaps PatchSM CV input pins to match documented order in datasheet, C++ API, and patch.init frontpanel. --- src/gpio.rs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/gpio.rs b/src/gpio.rs index 08edb99..5939bc7 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -170,10 +170,12 @@ pub struct PatchSmGPIO { pub c3: Option>, pub c4: Option>, pub c5: Option>, - pub c6: Option>, - pub c7: Option>, - pub c8: Option>, - pub c9: Option>, + // NOTE: C6-C9 are mismatched from the datasheet STM32 pin connections + // This is to match the documented "CVx" numbering that is used everywhere + pub c6: Option>, + pub c7: Option>, + pub c8: Option>, + pub c9: Option>, pub c10: Option>, pub d1: Option>>, pub d2: Option>, @@ -208,10 +210,12 @@ impl PatchSmGPIO { c3: Option>, c4: Option>, c5: Option>, - c6: Option>, - c7: Option>, - c8: Option>, - c9: Option>, + // Physical pin arguments stay in "physical" order to make this obvious, + // and easier to confirm w/ datasheet.. + c6_phys: Option>, + c7_phys: Option>, + c8_phys: Option>, + c9_phys: Option>, c10: Option>, d1: Option>>, d2: Option>, @@ -245,10 +249,11 @@ impl PatchSmGPIO { c3, c4, c5, - c6, - c7, - c8, - c9, + // Remap to match expected CV ordering in datasheet, frontpanels, etc. + c6: c9_phys, + c7: c8_phys, + c8: c6_phys, + c9: c7_phys, c10, d1, d2,