update to master (#52)

wch-ch32v003
Matt Knight 2 years ago committed by GitHub
parent 7fcaf17c46
commit ac19b7de8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -163,7 +163,7 @@ pub fn Uart(comptime index: usize) type {
const pclk = micro.clock.get() / 4; const pclk = micro.clock.get() / 4;
const divider = (pclk / (16 * config.baud_rate)); const divider = (pclk / (16 * config.baud_rate));
const regval = std.math.cast(u16, divider) catch return error.UnsupportedBaudRate; const regval = std.math.cast(u16, divider) orelse return error.UnsupportedBaudRate;
UARTn.DLL.modify(.{ .DLLSB = @truncate(u8, regval >> 0x00) }); UARTn.DLL.modify(.{ .DLLSB = @truncate(u8, regval >> 0x00) });
UARTn.DLM.modify(.{ .DLMSB = @truncate(u8, regval >> 0x08) }); UARTn.DLM.modify(.{ .DLMSB = @truncate(u8, regval >> 0x08) });

Loading…
Cancel
Save