Skip to content

How do I register an ISR for nrf52833 #1032

Description

@TJ-C

I can't find any examples, and this format was taken from a closed issue #188 however my ISR is not being pointed to in the vector table. Or to be more precise the vector table is not being modified.

pub const microzig = @import("microzig");
const regs = microzig.chip.peripherals;

pub var acceleration_data_ready: bool = false;

fn isr_for_accelerometer_acceleration_data() callconv(.C) void {
    if (regs.GPIOTE.EVENTS_IN[0].read().EVENTS_IN != .Generated) return;
    @atomicStore(bool, &acceleration_data_ready, true, .monotonic);
    regs.GPIOTE.EVENTS_IN[0].write(.{.EVENTS_IN = .NotGenerated}); // reset the interrupt
}

// 3. Register it with Microzig
pub const microzig_options = .{
    .interrupts = .{
        .GPIOTE = microzig.interrupt.Handler {
            .C = isr_for_accelerometer_acceleration_data
        }
    },
};

What is the correct way to register an ISR for nRF microcontrollers?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions