fix: reimpl debug reads w/out throwing away *const Self
This commit is contained in:
@@ -340,6 +340,10 @@ const Eeprom = struct {
|
||||
return self.reader.read();
|
||||
}
|
||||
|
||||
pub fn dbgRead(self: *const Self) u1 {
|
||||
return self.reader.dbgRead();
|
||||
}
|
||||
|
||||
pub fn write(self: *Self, word_count: u16, buf: *[]u8, bit: u1) void {
|
||||
if (self.guessKind(word_count)) |found| {
|
||||
log.info("EEPROM Kind: {}", .{found});
|
||||
@@ -492,6 +496,19 @@ const Eeprom = struct {
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
fn dbgRead(self: *const This) u1 {
|
||||
if (!self.enabled) return 1;
|
||||
|
||||
const bit = if (self.i < 4) blk: {
|
||||
break :blk 0;
|
||||
} else blk: {
|
||||
const idx = @intCast(u6, 63 - (self.i - 4));
|
||||
break :blk @truncate(u1, self.data >> idx);
|
||||
};
|
||||
|
||||
return bit;
|
||||
}
|
||||
};
|
||||
|
||||
const Writer = struct {
|
||||
|
Reference in New Issue
Block a user