aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/include/hal_st.h2
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h4
-rw-r--r--os/hal/src/hal_st.c2
-rw-r--r--readme.txt2
4 files changed, 10 insertions, 0 deletions
diff --git a/os/hal/include/hal_st.h b/os/hal/include/hal_st.h
index 1cc0460c2..e285877d5 100644
--- a/os/hal/include/hal_st.h
+++ b/os/hal/include/hal_st.h
@@ -84,10 +84,12 @@
extern "C" {
#endif
void stInit(void);
+#if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
void stStartAlarm(systime_t abstime);
void stStopAlarm(void);
void stSetAlarm(systime_t abstime);
systime_t stGetAlarm(void);
+#endif
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
index f1564c47d..156cd8902 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
@@ -89,6 +89,7 @@
#define STM32_HAS_TIM22 FALSE
#endif
+#if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
#if STM32_ST_USE_TIMER == 2
#if !STM32_HAS_TIM2
#error "TIM2 not present in the selected device"
@@ -158,6 +159,7 @@
#else
#error "STM32_ST_USE_TIMER specifies an unsupported timer"
#endif
+#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */
/*===========================================================================*/
/* Driver data structures and types. */
@@ -183,6 +185,7 @@ extern "C" {
/* Driver inline functions. */
/*===========================================================================*/
+#if (OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING) || defined(__DOXYGEN__)
/**
* @brief Returns the time counter value.
*
@@ -258,6 +261,7 @@ static inline bool st_lld_is_alarm_active(void) {
return (bool)((STM32_ST_TIM->DIER & STM32_TIM_DIER_CC1IE) != 0);
}
+#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */
#endif /* HAL_ST_LLD_H */
diff --git a/os/hal/src/hal_st.c b/os/hal/src/hal_st.c
index 3c613c1b2..0143185f8 100644
--- a/os/hal/src/hal_st.c
+++ b/os/hal/src/hal_st.c
@@ -62,6 +62,7 @@ void stInit(void) {
st_lld_init();
}
+#if (OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING) || defined(__DOXYGEN__)
/**
* @brief Starts the alarm.
* @note Makes sure that no spurious alarms are triggered after
@@ -123,6 +124,7 @@ systime_t stGetAlarm(void) {
return st_lld_get_alarm();
}
+#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */
#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */
diff --git a/readme.txt b/readme.txt
index a12cfcaec..5fa860b95 100644
--- a/readme.txt
+++ b/readme.txt
@@ -198,6 +198,8 @@
- EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1).
- EX: Updated LPS25H to 1.1.0 (backported to 18.2.1).
- EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
+- HAL: Fixed STM32 ST driver problem in free running mode (bug #997)
+ (backported to 18.2.3 and 17.6.5).
- HAL: Fixed invalid checks in STM32H7 HAL (bug #1000)
(backported to 18.2.2).
- OTH: Fixed problem in STM32H743 GCC linker file (bug #998)