Skip to content

Commit 169b97d

Browse files
committed
Fix some compile issues building pico-examples
1 parent 39a7f97 commit 169b97d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/rp2_common/hardware_flash/flash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ void flash_devinfo_set_cs_size(uint cs, flash_devinfo_size_t size) {
337337
uint cs_shift = cs == 0u ? OTP_DATA_FLASH_DEVINFO_CS0_SIZE_LSB : OTP_DATA_FLASH_DEVINFO_CS1_SIZE_LSB;
338338
uint cs_mask = OTP_DATA_FLASH_DEVINFO_CS0_SIZE_BITS >> OTP_DATA_FLASH_DEVINFO_CS0_SIZE_LSB;
339339
flash_devinfo_update_field(
340-
(uint)size << cs_shift,
341-
cs_mask << cs_shift
340+
(uint16_t)size << cs_shift,
341+
(uint16_t)cs_mask << cs_shift
342342
);
343343
}
344344

@@ -364,7 +364,7 @@ void flash_devinfo_set_cs_gpio(uint cs, uint gpio) {
364364
invalid_params_if(HARDWARE_FLASH, gpio >= NUM_BANK0_GPIOS);
365365
(void)cs;
366366
flash_devinfo_update_field(
367-
gpio << OTP_DATA_FLASH_DEVINFO_CS1_GPIO_LSB,
367+
(uint16_t)gpio << OTP_DATA_FLASH_DEVINFO_CS1_GPIO_LSB,
368368
OTP_DATA_FLASH_DEVINFO_CS1_GPIO_BITS
369369
);
370370
}

src/rp2_common/pico_bootrom/bootrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi
7676
flags |= BOOTSEL_FLAG_GPIO_PIN_ACTIVE_LOW;
7777
}
7878
}
79-
rom_reboot(REBOOT2_FLAG_REBOOT_TYPE_BOOTSEL | REBOOT2_FLAG_NO_RETURN_ON_SUCCESS, 10, flags, usb_activity_gpio_pin);
79+
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);
8080
__builtin_unreachable();
8181
#else
8282
panic_unsupported();

0 commit comments

Comments
 (0)