stm32: board_reset, keep legacy definition for old chips

This commit is contained in:
Simone Guscetti 2018-03-16 15:33:25 +01:00 committed by Beat Küng
parent 217a67f956
commit 20905ce478

View File

@ -62,7 +62,13 @@ int board_set_bootload_mode(board_reset_e mode)
}
stm32_pwr_enablebkp(true);
*(uint32_t *)STM32_RTC_BKR(0) = regvalue;
// Check if we can to use the new register definition
#ifndef STM32_RTC_BK0R
*(uint32_t *)STM32_BKP_BASE = regvalue;
#else
*(uint32_t *)STM32_RTC_BK0R = regvalue;
#endif
stm32_pwr_enablebkp(false);
return OK;
}