pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

NUM_RESETS is wrong for both rp2040 and rp2350

Open peterharperuk opened this issue 3 months ago • 3 comments

#define NUM_RESETS _u(24)

It should be 25?

typedef enum reset_num_rp2040 {
...
    RESET_USBCTRL = 24, ///< Select USBCTRL to be reset
    RESET_COUNT
} reset_num_t;

peterharperuk avatar Sep 23 '25 15:09 peterharperuk

Same thing seems to affect RP2350 too?

But it looks like the only places where NUM_RESETS is used, it's being compared using > rather than >=, which is why I guess this has never caused any problems?

invalid_params_if(HARDWARE_RESETS, block_num > NUM_RESETS);

lurch avatar Sep 23 '25 16:09 lurch

Yes, it's wrong for rp2350 as well.

peterharperuk avatar Sep 23 '25 17:09 peterharperuk

note this is in header generation already, but still needs to be merged

kilograham avatar Sep 29 '25 14:09 kilograham