Use auto-generated hardware/structs/ headers (based off SVD) SVD errors fixed.

This commit is contained in:
Graham Sanderson
2021-10-12 09:15:19 -05:00
committed by GitHub
parent a793222331
commit 2f2e62968d
34 changed files with 3189 additions and 299 deletions

View File

@ -73,6 +73,13 @@ typedef volatile uint8_t io_wo_8;
typedef volatile uint8_t *const ioptr;
typedef ioptr const const_ioptr;
// A non-functional (empty) helper macro to help IDEs follow links from the autogenerated
// hardware struct headers in hardware/structs/xxx.h to the raw register definitions
// in hardware/regs/xxx.h. A preprocessor define such as TIMER_TIMEHW_OFFSET (a timer register offset)
// is not generally clickable (in an IDE) if placed in a C comment, so _REG_(TIMER_TIMEHW_OFFSET) is
// included outside of a comment instead
#define _REG_(x)
// Helper method used by hw_alias macros to optionally check input validity
static __force_inline uint32_t hw_alias_check_addr(volatile void *addr) {
uint32_t rc = (uintptr_t)addr;

View File

@ -142,7 +142,7 @@ static void gpio_irq_handler(void) {
io_irq_ctrl_hw_t *irq_ctrl_base = get_core_num() ?
&iobank0_hw->proc1_irq_ctrl : &iobank0_hw->proc0_irq_ctrl;
for (uint gpio = 0; gpio < NUM_BANK0_GPIOS; gpio++) {
io_rw_32 *status_reg = &irq_ctrl_base->ints[gpio / 8];
io_ro_32 *status_reg = &irq_ctrl_base->ints[gpio / 8];
uint events = (*status_reg >> 4 * (gpio % 8)) & 0xf;
if (events) {
// TODO: If both cores care about this event then the second core won't get the irq?