MustafaMulla29/rp2040-bldc-motor-controller-new
73×72 mm 4-layer USB‑C PD (5/9/15/20 V) RP2040 controller PCB with protected power switching, MCT8329A sensorless BLDC three-phase MOSFET bridge, USB data/programming, onboard controls, and three motor outputs feeding a 2212 motor through rigid bullet adapters.
- Version
- 0.3.100
- License
- unset
- Stars
- 0
assembly/vendor/cableprinter-wire-colour.patch
--- a/lib/parse-cable-string.ts
+++ b/lib/parse-cable-string.ts
@@ -7,6 +7,14 @@
/** Named cable presets, or adaptercable_a(CONNECTOR)_b(CONNECTOR). */
export function parseCableString(cableString: string): CableDefinition {
const cableName = cableString.trim().toLowerCase()
+ // Local single-wire colour suffix; preserves named end parsing and defaults.
+ const colorSuffix = /^(adaptercable_.+)_color([0-9a-f]{6})$/.exec(cableName)
+ if (colorSuffix) {
+ const definition = parseCableString(colorSuffix[1]!)
+ if (definition.crossSection.kind !== "round_jacket")
+ throw new Error("A colour suffix requires a single round wire")
+ return { ...definition, crossSection: { ...definition.crossSection, color: `#${colorSuffix[2]}` } }
+ }
if (cableName.startsWith("adaptercable")) {
const adapter = /^adaptercable_(a|b)\(([^()]+)\)_(a|b)\(([^()]+)\)$/.exec(
cableName,