Make kitchen_sink check param assertions, and include all headers - fix sign-compare warnings (#316)

This commit is contained in:
Graham Sanderson
2021-04-06 20:50:26 -05:00
committed by GitHub
parent 0911393fe2
commit 92f948c123
6 changed files with 53 additions and 19 deletions

View File

@ -27,7 +27,7 @@ int gpio_get_pad(uint gpio) {
// This also clears the input/output/irq override bits.
void gpio_set_function(uint gpio, enum gpio_function fn) {
invalid_params_if(GPIO, gpio >= NUM_BANK0_GPIOS);
invalid_params_if(GPIO, fn << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB & ~IO_BANK0_GPIO0_CTRL_FUNCSEL_BITS);
invalid_params_if(GPIO, ((uint32_t)fn << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB) & ~IO_BANK0_GPIO0_CTRL_FUNCSEL_BITS);
// Set input enable on, output disable off
hw_write_masked(&padsbank0_hw->io[gpio],
PADS_BANK0_GPIO0_IE_BITS,