From d253056c71327003ea357ee601f5f8508788acf5 Mon Sep 17 00:00:00 2001 From: Matt Knight Date: Fri, 27 May 2022 08:58:42 -0700 Subject: [PATCH] cortex-m0plus and fix for missing hal (#49) --- src/core/microzig.zig | 2 ++ src/modules/cpus.zig | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/core/microzig.zig b/src/core/microzig.zig index 8df10fc..0353d35 100644 --- a/src/core/microzig.zig +++ b/src/core/microzig.zig @@ -24,6 +24,8 @@ pub const board = if (config.has_board) @import("board") else void; /// Provides access to the low level features of the CPU. pub const cpu = @import("cpu"); +pub const hal = @import("hal"); + /// Module that helps with interrupt handling. pub const interrupts = @import("interrupts.zig"); diff --git a/src/modules/cpus.zig b/src/modules/cpus.zig index 95f37e4..3c739c1 100644 --- a/src/modules/cpus.zig +++ b/src/modules/cpus.zig @@ -18,6 +18,17 @@ pub const avr5 = Cpu{ }, }; +pub const cortex_m0plus = Cpu{ + .name = "ARM Cortex-M0+", + .path = root_path ++ "cpus/cortex-m/cortex-m.zig", + .target = std.zig.CrossTarget{ + .cpu_arch = .thumb, + .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m0plus }, + .os_tag = .freestanding, + .abi = .none, + }, +}; + pub const cortex_m3 = Cpu{ .name = "ARM Cortex-M3", .path = root_path ++ "cpus/cortex-m/cortex-m.zig",