#ifdef only on __STRICT_ANSI__

Also fix devinfo type
This commit is contained in:
William Vinnicombe 2025-04-09 17:55:00 +01:00
parent 71fd66c40d
commit 676e200388
2 changed files with 10 additions and 1 deletions

View File

@ -299,7 +299,11 @@ static void flash_devinfo_update_field(uint16_t wdata, uint16_t mask) {
// Boot RAM does not support exclusives, but does support RWTYPE SET/CLR/XOR (with byte
// strobes). Can't use hw_write_masked because it performs a 32-bit write.
io_rw_16 *devinfo = flash_devinfo_ptr();
*(io_rw_32 *)hw_xor_alias_untyped(devinfo) = (*devinfo ^ wdata) & mask;
#ifdef __STRICT_ANSI__
*(io_rw_16 *)hw_xor_alias_untyped(devinfo) = (*devinfo ^ wdata) & mask;
#else
*hw_xor_alias(devinfo) = (*devinfo ^ wdata) & mask;
#endif
}
// This is a RAM function because may be called during flash programming to enable save/restore of

View File

@ -101,8 +101,13 @@ int core1_wrapper(int (*entry)(void), void *stack_base) {
void multicore_reset_core1(void) {
// Use atomic aliases just in case core 1 is also manipulating some PSM state
io_rw_32 *power_off = (io_rw_32 *) (PSM_BASE + PSM_FRCE_OFF_OFFSET);
#ifdef __STRICT_ANSI__
io_rw_32 *power_off_set = hw_set_alias_untyped(power_off);
io_rw_32 *power_off_clr = hw_clear_alias_untyped(power_off);
#else
io_rw_32 *power_off_set = hw_set_alias(power_off);
io_rw_32 *power_off_clr = hw_clear_alias(power_off);
#endif
// Hard-reset core 1.
// Reading back confirms the core 1 reset is in the correct state, but also