Add some extra defines to platform_defs.h (#227)

This commit is contained in:
Andrew Scheller
2021-03-04 18:52:42 +00:00
committed by graham sanderson
parent 62b2d33e8f
commit dff0633c20
2 changed files with 6 additions and 1 deletions

View File

@ -84,7 +84,7 @@ static inline void adc_gpio_init(uint gpio) {
* \param input Input to select.
*/
static inline void adc_select_input(uint input) {
invalid_params_if(ADC, input > 4);
valid_params_if(ADC, input < NUM_ADC_CHANNELS);
hw_write_masked(&adc_hw->cs, input << ADC_CS_AINSEL_LSB, ADC_CS_AINSEL_BITS);
}