We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84d7a7e commit 7c1b479Copy full SHA for 7c1b479
1 file changed
port/raspberrypi/rp2xxx/src/hal/system_timer.zig
@@ -43,7 +43,12 @@ pub const Timer = enum(u1) {
43
/// Enables or disables the interrupt for the given alarm.
44
pub fn set_interrupt_enabled(timer: Timer, alarm: Alarm, enable: bool) void {
45
const regs = timer.get_regs();
46
- regs.INTE.write_raw(@as(u4, @intFromBool(enable)) << @intFromEnum(alarm));
+ switch (alarm) {
47
+ .alarm0 => regs.INTE.modify(.{ .ALARM_0 = @intFromBool(enable) }),
48
+ .alarm1 => regs.INTE.modify(.{ .ALARM_1 = @intFromBool(enable) }),
49
+ .alarm2 => regs.INTE.modify(.{ .ALARM_2 = @intFromBool(enable) }),
50
+ .alarm3 => regs.INTE.modify(.{ .ALARM_3 = @intFromBool(enable) }),
51
+ }
52
}
53
54
/// Clears the interrupt flag for the given alarm.
0 commit comments