We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3880986 commit 9208733Copy full SHA for 9208733
port/raspberrypi/rp2xxx/src/hal/adc.zig
@@ -60,10 +60,11 @@ pub fn apply(config: Config) void {
60
});
61
62
if (config.sample_frequency) |sample_frequency| {
63
+ assert(sample_frequency <= 500_000);
64
const cycles = (48_000_000 * 256) / @as(u64, sample_frequency);
65
ADC.DIV.write(.{
66
.FRAC = @as(u8, @truncate(cycles)),
- .INT = @as(u16, @intCast((cycles >> 8) - 1)),
67
+ .INT = @as(u16, @intCast((cycles >> 8))),
68
69
}
70
0 commit comments