Merge pull request #96 from SamTebbs33/feature/ci-formatting-check

Add formatting check to CI
This commit is contained in:
Sam Tebbs 2019-10-06 20:04:17 +01:00 committed by GitHub
commit 032d08ebfe
2 changed files with 7 additions and 5 deletions

View file

@ -29,3 +29,5 @@ jobs:
sudo apt-get install qemu qemu-system --fix-missing
- name: Run runtime tests
run: zig*/zig build test -Drt-test=true ${{ matrix.build_mode }}
- name: Check formatting
run: zig*/zig fmt --check src

View file

@ -13,15 +13,13 @@ const PARITY_BIT = false;
pub const DEFAULT_BAUDRATE = 38400;
const SerialError = error {
InvalidBaud
};
const SerialError = error{InvalidBaud};
pub const Port = enum(u16) {
COM1 = 0x3F8,
COM2 = 0x2F8,
COM3 = 0x3E8,
COM4 = 0x2E8
COM4 = 0x2E8,
};
// Compute a value that encodes the serial properties
@ -69,7 +67,9 @@ pub fn init(baud: u32, port: Port) SerialError!void {
}
pub fn write(char: u8, port: Port) void {
while (!transmitIsEmpty(port)) { arch.halt(); }
while (!transmitIsEmpty(port)) {
arch.halt();
}
arch.outb(@enumToInt(port), char);
}