Skip to content

Commit 2f83bf8

Browse files
committed
fix(pwm): incorrect pin mapping
PWM channel incorrectly mapped for pins above 16
1 parent 5007a6a commit 2f83bf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/peripherals/pwm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class PWMChannel {
7979
// GPIO pin indices: Table 525. Mapping of PWM channels to GPIO pins on RP2040
8080
readonly pinA1 = this.index * 2;
8181
readonly pinB1 = this.index * 2 + 1;
82-
readonly pinA2 = this.index < 7 ? 16 + this.index * 2 + 1 : -1;
82+
readonly pinA2 = this.index < 7 ? 16 + this.index * 2 : -1;
8383
readonly pinB2 = this.index < 7 ? 16 + this.index * 2 + 1 : -1;
8484

8585
constructor(private pwm: RPPWM, readonly clock: IClock, readonly index: number) {

0 commit comments

Comments
 (0)