Official STMicroelectronics Arduino Core STM32F4 HAL compatibility (#11006)
This commit is contained in:
committed by
Scott Lahteine
parent
4dbec774b5
commit
e0276d2f32
@@ -21,8 +21,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef STM32F4
|
||||
#if defined(STM32F4) || defined(STM32F4xx)
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
@@ -81,17 +80,11 @@ void sei(void) { interrupts(); }
|
||||
void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||
|
||||
uint8_t HAL_get_reset_source (void) {
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET)
|
||||
return RST_WATCHDOG;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
|
||||
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET)
|
||||
return RST_SOFTWARE;
|
||||
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET)
|
||||
return RST_EXTERNAL;
|
||||
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET)
|
||||
return RST_POWER_ON;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL;
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -137,4 +130,4 @@ uint16_t HAL_adc_get_result(void) {
|
||||
return HAL_adc_result;
|
||||
}
|
||||
|
||||
#endif // STM32F4
|
||||
#endif // STM32F4 || STM32F4xx
|
||||
|
||||
Reference in New Issue
Block a user