diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e679702..578e72d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,8 +45,8 @@ jobs: - name: Install (Ubuntu) if: matrix.os == 'ubuntu' run: | - curl -L https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz | tar -xJf - - echo "$(pwd)/zig-linux-x86_64-0.8.0" >> $GITHUB_PATH + curl -L https://ziglang.org/download/0.9.0/zig-linux-x86_64-0.9.0.tar.xz | tar -xJf - + echo "$(pwd)/zig-linux-x86_64-0.9.0" >> $GITHUB_PATH - name: Install (Mac OS) if: matrix.os == 'macos' @@ -55,7 +55,7 @@ jobs: - name: Install (Windows) if: matrix.os == 'windows' run: | - choco install zig --version 0.8.0 + choco install zig --version 0.9.0 ln -s $(which python) /usr/bin/python3 - run: python ./get-toolchain.py diff --git a/riscv-zig-blink/README.md b/riscv-zig-blink/README.md index 7b4c5e9..39c330c 100644 --- a/riscv-zig-blink/README.md +++ b/riscv-zig-blink/README.md @@ -1,12 +1,12 @@ # riscv-zig-blink -Written against zig 0.8.0 +Written against zig 0.9.0 You can obtain the zig compiler via https://ziglang.org/download/ e.g. a linux user might run: ``` -curl -L https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz | tar -xJf - -alias zig=./zig-linux-x86_64-0.8.0/zig +curl -L https://ziglang.org/download/0.9.0/zig-linux-x86_64-0.9.0.tar.xz | tar -xJf - +alias zig=./zig-linux-x86_64-0.9.0/zig ``` Run `zig build --help` from this directory for usage and options. diff --git a/riscv-zig-blink/build.zig b/riscv-zig-blink/build.zig index 4513a5e..d28629f 100644 --- a/riscv-zig-blink/build.zig +++ b/riscv-zig-blink/build.zig @@ -14,7 +14,7 @@ pub fn build(b: *Builder) void { .explicit = &std.Target.riscv.cpu.generic_rv32, }, }); - elf.setLinkerScriptPath("ld/linker.ld"); + elf.setLinkerScriptPath(.{ .path = "ld/linker.ld" }); elf.setBuildMode(mode); // The ELF file contains debug symbols and can be passed to gdb for remote debugging if (b.option(bool, "emit-elf", "Should an ELF file be emitted in the current directory?") orelse false) { diff --git a/riscv-zig-blink/src/fomu.zig b/riscv-zig-blink/src/fomu.zig index 239f714..6ff5bf5 100644 --- a/riscv-zig-blink/src/fomu.zig +++ b/riscv-zig-blink/src/fomu.zig @@ -17,6 +17,7 @@ comptime { /// Panic function that sets LED to red and flashing + prints the panic message over messible pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn { @setCold(true); + _ = stack_trace; // Put LED into non-raw flashing mode RGB.CTRL.* = .{ @@ -49,6 +50,7 @@ pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noretur const WriteError = error{}; fn messibleWrite(self: void, bytes: []const u8) WriteError!usize { + _ = self; while (true) { const bytes_written = MESSIBLE.write(bytes); if (bytes_written != 0) return bytes_written; @@ -58,6 +60,7 @@ pub const messibleWriter = std.io.Writer(void, WriteError, messibleWrite){ .cont const ReadError = error{}; fn messibleRead(self: void, buffer: []u8) ReadError!usize { + _ = self; while (true) { const bytes_read = MESSIBLE.read(buffer); if (bytes_read != 0) return bytes_read; diff --git a/riscv-zig-blink/src/fomu/rgb.zig b/riscv-zig-blink/src/fomu/rgb.zig index edcab01..1d0c606 100644 --- a/riscv-zig-blink/src/fomu/rgb.zig +++ b/riscv-zig-blink/src/fomu/rgb.zig @@ -14,7 +14,7 @@ pub const RGB = struct { /// Writing to this register has no immediate effect – data isn’t written until the DAT register is written. pub const ADDR = @intToPtr(*volatile u4, base + 0x4); - pub const Register = enum { + pub const Register = enum(u4) { PWRR = 1, PWRG = 2, PWRB = 3,