Skip to content

Commit

Permalink
adding nvic for cortex m0+, fixing little bug with stringToEnum (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
freiguy1 authored Nov 8, 2024
1 parent 32a76b7 commit d6a97c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/cpus/cortex_m.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Core = enum {
};

const core: type = blk: {
const cortex_m = std.meta.stringToEnum(microzig.config.cpu_name) orelse @panic(std.fmt.comptimePrint("Unrecognized Cortex-M core name: {s}", .{microzig.config.cpu_name}));
const cortex_m = std.meta.stringToEnum(Core, microzig.config.cpu_name) orelse @panic(std.fmt.comptimePrint("Unrecognized Cortex-M core name: {s}", .{microzig.config.cpu_name}));
break :blk switch (cortex_m) {
.@"ARM Cortex-M0" => @import("cortex_m/m0"),
.@"ARM Cortex-M0+" => @import("cortex_m/m0plus.zig"),
Expand Down
19 changes: 18 additions & 1 deletion core/src/cpus/cortex_m/m0plus.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
pub const SystemControlBlock = @compileError("TODO");
pub const NestedVectorInterruptController = @compileError("TODO");

pub const NestedVectorInterruptController = extern struct {
/// Interrupt set registers.
ISER: u32,
_reserved0: [31]u32,
/// Interrupt clear enable registers.
ICER: u32,
_reserved1: [31]u32,
/// Interrupt set pending registers.
ISPR: u32,
_reserved2: [31]u32,
/// Interrupt clear pending registers.
ICPR: u32,
_reserved3: [31]u32,
/// Interrupt priority registers.
IPR: [28]u8,
};

pub const MemoryProtectionUnit = @compileError("TODO");

0 comments on commit d6a97c9

Please sign in to comment.