From 5c853fd23ad400ecb748fba7acb2cc2c0a77c053 Mon Sep 17 00:00:00 2001 From: Matt Knight Date: Fri, 30 Sep 2022 12:32:37 -0700 Subject: [PATCH] use compile errors instead of comments (#15) --- src/hal/adc.zig | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/hal/adc.zig b/src/hal/adc.zig index a700651..84b99a7 100644 --- a/src/hal/adc.zig +++ b/src/hal/adc.zig @@ -161,34 +161,40 @@ pub inline fn run(enable: bool) void { ADC.CS.modify(.{ .START_MANY = if (enable) @as(u1, 1) else @as(u1, 0) }); } -/// TODO: implement -pub inline fn setClkDiv() void {} +pub inline fn setClkDiv() void { + @compileError("todo"); +} /// The fifo is 4 samples long, if a conversion is completed and the FIFO is /// full, the result is dropped. pub const fifo = struct { - /// TODO: implement pub inline fn setup() void { + @compileError("todo"); // There are a number of considerations wrt DMA and error detection } - /// TODO: implement /// Return true if FIFO is empty. - pub inline fn isEmpty() bool {} + pub inline fn isEmpty() bool { + @compileError("todo"); + } - /// TODO: implement /// Read how many samples are in the FIFO. - pub inline fn getLevel() u8 {} + pub inline fn getLevel() u8 { + @compileError("todo"); + } - /// TODO: implement /// Pop latest result from FIFO. - pub inline fn get() u16 {} + pub inline fn get() u16 { + @compileError("todo"); + } - /// TODO: implement /// Block until result is available in FIFO, then pop it. - pub inline fn getBlocking() u16 {} + pub inline fn getBlocking() u16 { + @compileError("todo"); + } - /// TODO: implement /// Wait for conversion to complete then discard results in FIFO. - pub inline fn drain() void {} + pub inline fn drain() void { + @compileError("todo"); + } };