Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/core/usb/drivers/hid.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}
};
Expand Down
6 changes: 3 additions & 3 deletions port/raspberrypi/rp2xxx/src/hal/adc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}

Expand All @@ -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),
};
}

Expand All @@ -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 => {},
}
}

Expand Down
Loading