|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
const vector_table_type = [256] *const fn () void;
|
|
|
|
|
extern const init_vector_table: [2]u32;
|
|
|
|
|
|
|
|
|
|
const vector_table_type = [128] *const fn () void; // up to 256
|
|
|
|
|
var vector_table: vector_table_type align(256) = undefined;
|
|
|
|
|
var vtor: **volatile vector_table_type = @ptrFromInt(0xE000ED08);
|
|
|
|
|
|
|
|
|
|
pub const vector = enum(u8) {
|
|
|
|
|
pub const vector = enum(u7) {
|
|
|
|
|
NMI = 2,
|
|
|
|
|
HardFault,
|
|
|
|
|
MemManage,
|
|
|
|
@ -20,6 +22,8 @@ pub const vector = enum(u8) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pub fn initialize() void {
|
|
|
|
|
vector_table[0] = @ptrFromInt(init_vector_table[0]);
|
|
|
|
|
vector_table[1] = @ptrFromInt(init_vector_table[1]);
|
|
|
|
|
register(.NMI, nmi);
|
|
|
|
|
register(.HardFault, hardfault);
|
|
|
|
|
register(.MemManage, memmanage);
|
|
|
|
|