diff options
Diffstat (limited to 'os/halnew')
-rw-r--r-- | os/halnew/osal/chibios/osal.h | 23 | ||||
-rw-r--r-- | os/halnew/platforms/STM32F30x/adc_lld.c | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/os/halnew/osal/chibios/osal.h b/os/halnew/osal/chibios/osal.h index 9c6170d4b..ca3c3f8b5 100644 --- a/os/halnew/osal/chibios/osal.h +++ b/os/halnew/osal/chibios/osal.h @@ -95,7 +95,7 @@ /**
* @brief Required systick frequency or resolution.
*/
-#define OSAL_SYSTICK_FREQUENCY CH_CFG_FREQUENCY
+#define OSAL_SYSTICK_FREQUENCY CH_CFG_ST_FREQUENCY
/*===========================================================================*/
/* Module pre-compile time settings. */
@@ -123,6 +123,13 @@ typedef int32_t msg_t; typedef uint32_t systime_t;
#endif
+#if 0
+/**
+ * @brief Type of realtime counter.
+ */
+typedef uint32_t rtcnt_t;
+#endif
+
/**
* @brief Type of a thread reference.
*/
@@ -310,6 +317,20 @@ static inline void osalSysUnlockFromISR(void) { }
/**
+ * @brief Polled delay.
+ * @note The real delay is always few cycles in excess of the specified
+ * value.
+ *
+ * @param[in] cycles number of cycles
+ *
+ * @xclass
+ */
+static inline void osalSysPolledDelayX(rtcnt_t cycles) {
+
+ chSysPolledDelayX(cycles);
+}
+
+/**
* @brief Systick callback for the underlying OS.
* @note This callback is only defined if the OSAL requires such a
* service from the HAL.
diff --git a/os/halnew/platforms/STM32F30x/adc_lld.c b/os/halnew/platforms/STM32F30x/adc_lld.c index e951df14e..009f4dde3 100644 --- a/os/halnew/platforms/STM32F30x/adc_lld.c +++ b/os/halnew/platforms/STM32F30x/adc_lld.c @@ -89,7 +89,7 @@ static void adc_lld_vreg_on(ADCDriver *adcp) { #if STM32_ADC_DUAL_MODE
adcp->adcs->CR = ADC_CR_ADVREGEN_0;
#endif
- halPolledDelay(US2RTT(10));
+ osalSysPolledDelayX(US2RTC(10));
}
/**
|