Skip to content

Conversation

@ikskuh
Copy link
Contributor

@ikskuh ikskuh commented Jul 27, 2025

No description provided.

};
}

const ReleaseExceptionHandler = struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this just to save on code + data size on release builds?

for (program.instructions, program.relocations, offset..) |insn, reloc, i|
instruction_memory[i] = switch (reloc) {
.none => insn,
.jmpslot => blk: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind just adding a comment here reminding us how you're doing the reloc

.jmpslot => blk: {
const Jmp = packed struct(u16) { address: u5, reset: u11 };
var jmp: Jmp = @bitCast(insn);
jmp.address += offset;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In release this won't catch if offset + address overflows. Do we have a guarantee that the offset will be in the correct range? Probably worse a comment asserting that.

fn pin_to_index(self: EnumType, pin: gpio.Pin) error{InvalidPin}!u5 {
const index = @intFromEnum(pin);
const base = (0x10 & self.get_regs().GPIOBASE.raw);
if (index < base or index >= base + 32) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this OK for rp2350? the 32 is the number of pins that be setup in pio, not how many pins the chip has, correct?

}
pub fn sm_set_pin_mappings(self: EnumType, sm: StateMachine, options: PinMappingOptions) void {

pub fn sm_set_pin_mappings(self: EnumType, sm: StateMachine, options: PinMappingOptions) !void {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is InvalidPin the only error we can get here?


const IrqHandlerFn = *const fn () callconv(.c) void;

fn debugExceptionHandler(comptime name: []const u8) IrqHandlerFn {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to debug_exception_handler, in MicroZig we use snake case for function names.

… Adds deadlines to UART.reader() and UART.writer(), adds support for high priority DMA
@mattnite
Copy link
Contributor

@ikskuh are you going to fix this up?

@Grazfather
Copy link
Collaborator

This'll require a conflict resolution after #700

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants