Skip to content

rp2xxx: fixed bug in get_pwm - #1014

Merged
Grazfather merged 1 commit into
ZigEmbeddedGroup:mainfrom
Kytezign:patch-10
Aug 13, 2026
Merged

rp2xxx: fixed bug in get_pwm#1014
Grazfather merged 1 commit into
ZigEmbeddedGroup:mainfrom
Kytezign:patch-10

Conversation

@Kytezign

Copy link
Copy Markdown
Contributor

Without this I get the following error:

zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/port/raspberrypi/rp2xxx/src/hal/pwm.zig:70:51: error: expected type 'u1', found 'u32'
    const chan: Channel = @fromBackingInt(tmp_num & 1);
                                          ~~~~~~~~^~~
zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/port/raspberrypi/rp2xxx/src/hal/pwm.zig:70:51: note: unsigned 1-bit int cannot represent all possible unsigned 32-bit values referenced by:
    main: src/main.zig:49:33
    microzig_main: zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/core/src/microzig.zig:151:13

WIthout this I get 

zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/port/raspberrypi/rp2xxx/src/hal/pwm.zig:70:51: error: expected type 'u1', found 'u32'
    const chan: Channel = @fromBackingInt(tmp_num & 1);
                                          ~~~~~~~~^~~
zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/port/raspberrypi/rp2xxx/src/hal/pwm.zig:70:51: note: unsigned 1-bit int cannot represent all possible unsigned 32-bit values
referenced by:
    main: src/main.zig:49:33
    microzig_main: zig-pkg/microzig-0.15.2-D20YSdG94gDWSUaMverG182uPMyOlXtumPtLxs-uRyQ9/core/src/microzig.zig:151:13
@Grazfather Grazfather changed the title fixed bug in get_pwm rp2xxx: fixed bug in get_pwm Aug 13, 2026
@Grazfather
Grazfather merged commit 0ddb987 into ZigEmbeddedGroup:main Aug 13, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants