-
Couldn't load subscription status.
- Fork 147
RP2xxx PIO and Reset fixes #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…hen adding the program
…prove api for 48 pin RP2350B variant
| }; | ||
| } | ||
|
|
||
| const ReleaseExceptionHandler = struct { |
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
|
@ikskuh are you going to fix this up? |
|
This'll require a conflict resolution after #700 |
No description provided.