Skip to content

Commit

Permalink
Fix some compile issues building pico-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
peterharperuk committed Nov 23, 2024
1 parent 39a7f97 commit 169b97d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/rp2_common/hardware_flash/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ void flash_devinfo_set_cs_size(uint cs, flash_devinfo_size_t size) {
uint cs_shift = cs == 0u ? OTP_DATA_FLASH_DEVINFO_CS0_SIZE_LSB : OTP_DATA_FLASH_DEVINFO_CS1_SIZE_LSB;
uint cs_mask = OTP_DATA_FLASH_DEVINFO_CS0_SIZE_BITS >> OTP_DATA_FLASH_DEVINFO_CS0_SIZE_LSB;
flash_devinfo_update_field(
(uint)size << cs_shift,
cs_mask << cs_shift
(uint16_t)size << cs_shift,
(uint16_t)cs_mask << cs_shift
);
}

Expand All @@ -364,7 +364,7 @@ void flash_devinfo_set_cs_gpio(uint cs, uint gpio) {
invalid_params_if(HARDWARE_FLASH, gpio >= NUM_BANK0_GPIOS);
(void)cs;
flash_devinfo_update_field(
gpio << OTP_DATA_FLASH_DEVINFO_CS1_GPIO_LSB,
(uint16_t)gpio << OTP_DATA_FLASH_DEVINFO_CS1_GPIO_LSB,
OTP_DATA_FLASH_DEVINFO_CS1_GPIO_BITS
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_bootrom/bootrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi
flags |= BOOTSEL_FLAG_GPIO_PIN_ACTIVE_LOW;
}
}
rom_reboot(REBOOT2_FLAG_REBOOT_TYPE_BOOTSEL | REBOOT2_FLAG_NO_RETURN_ON_SUCCESS, 10, flags, usb_activity_gpio_pin);
rom_reboot(REBOOT2_FLAG_REBOOT_TYPE_BOOTSEL | REBOOT2_FLAG_NO_RETURN_ON_SUCCESS, 10, flags, usb_activity_gpio_pin >= 0 ? (uint32_t)usb_activity_gpio_pin : NUM_BANK0_GPIOS);
__builtin_unreachable();
#else
panic_unsupported();
Expand Down

0 comments on commit 169b97d

Please sign in to comment.