Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit da9c39c

Browse files
author
Felix "xq" Queißner
committed
Fixes invalid aviron.io.RAM size reporting, fixes invalid output on --info
1 parent fb6a2ab commit da9c39c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/io.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub const RAM = struct {
109109
return RAM{
110110
.ctx = self,
111111
.vtable = &vtable,
112-
.size = @divExact(size, 2),
112+
.size = size,
113113
};
114114
}
115115

src/main.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn main() !u8 {
3131
var eeprom = aviron.EEPROM.Static(1024){};
3232
var io = IO{
3333
.sreg = undefined,
34-
.sp = 2047,
34+
.sp = sram.data.len - 1,
3535
};
3636

3737
var cpu = aviron.Cpu{
@@ -66,8 +66,8 @@ pub fn main() !u8 {
6666
try stdout.print("Information for {s}:\n", .{@tagName(cli.options.mcu)});
6767
try stdout.print(" Generation: {s: >11}\n", .{@tagName(cpu.instruction_set)});
6868
try stdout.print(" Code Model: {s: >11}\n", .{@tagName(cpu.code_model)});
69-
try stdout.print(" RAM: {d: >5} bytes\n", .{cpu.flash.size});
70-
try stdout.print(" Flash: {d: >5} bytes\n", .{cpu.sram.size});
69+
try stdout.print(" Flash: {d: >5} bytes\n", .{cpu.flash.size});
70+
try stdout.print(" RAM: {d: >5} bytes\n", .{cpu.sram.size});
7171
try stdout.print(" EEPROM: {d: >5} bytes\n", .{cpu.eeprom.size});
7272
return 0;
7373
}

0 commit comments

Comments
 (0)