File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
rp2040/hardware_regs/include/hardware
rp2_common/hardware_adc/include/hardware Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 2525#define NUM_PWM_SLICES _u(8)
2626#define NUM_SPIN_LOCKS _u(32)
2727#define NUM_UARTS _u(2)
28+ #define NUM_I2CS _u(2)
29+ #define NUM_SPIS _u(2)
30+
31+ #define NUM_ADC_CHANNELS _u(5)
32+
2833#define NUM_BANK0_GPIOS _u(30)
2934
3035#define PIO_INSTRUCTION_COUNT _u(32)
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ static inline void adc_gpio_init(uint gpio) {
8484 * \param input Input to select.
8585 */
8686static inline void adc_select_input (uint input ) {
87- invalid_params_if (ADC , input > 4 );
87+ valid_params_if (ADC , input < NUM_ADC_CHANNELS );
8888 hw_write_masked (& adc_hw -> cs , input << ADC_CS_AINSEL_LSB , ADC_CS_AINSEL_BITS );
8989}
9090
You can’t perform that action at this time.
0 commit comments