diff --git a/build.zig b/build.zig index 7f39f7207..bdf6cdcc1 100644 --- a/build.zig +++ b/build.zig @@ -69,6 +69,8 @@ pub fn build(b: *Build) void { builder.addRule(.{ .builtin = .no_hidden_allocations }, .{}); builder.addRule(.{ .builtin = .no_deprecated }, .{}); builder.addRule(.{ .builtin = .require_fmt }, .{}); + builder.addRule(.{ .builtin = .switch_case_ordering }, .{}); + break :step builder.build(); }); } diff --git a/core/src/core/usb/drivers/hid.zig b/core/src/core/usb/drivers/hid.zig index 49205c845..438ea20d9 100644 --- a/core/src/core/usb/drivers/hid.zig +++ b/core/src/core/usb/drivers/hid.zig @@ -63,8 +63,8 @@ pub const ReportItem = union(enum) { pub fn local(self: @This()) i32 { return switch (self) { - inline else => |x| @backingInt(x), .vendor => |x| x, + inline else => |x| @backingInt(x), }; } }; diff --git a/port/raspberrypi/rp2xxx/src/hal/adc.zig b/port/raspberrypi/rp2xxx/src/hal/adc.zig index 19e3b5754..38884925a 100644 --- a/port/raspberrypi/rp2xxx/src/hal/adc.zig +++ b/port/raspberrypi/rp2xxx/src/hal/adc.zig @@ -111,8 +111,8 @@ pub const Input = if (has_rp2350b) pub fn get_gpio_pin(in: Input) gpio.Pin { return switch (in) { - else => gpio.num(@as(u9, @backingInt(in)) + 40), .temp_sensor => @panic("temp_sensor doesn't have a pin"), + else => gpio.num(@as(u9, @backingInt(in)) + 40), }; } @@ -131,8 +131,8 @@ else pub fn get_gpio_pin(in: Input) gpio.Pin { return switch (in) { - else => gpio.num(@as(u5, @backingInt(in)) + 26), .temp_sensor => @panic("temp_sensor doesn't have a pin"), + else => gpio.num(@as(u5, @backingInt(in)) + 26), }; } @@ -143,13 +143,13 @@ else /// input. pub fn configure_gpio_pin_num(in: Input) void { switch (in) { + .temp_sensor => {}, else => { const pin = in.get_gpio_pin(); pin.set_function(.disabled); pin.set_pull(.disabled); pin.set_input_enabled(false); }, - .temp_sensor => {}, } }