aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-17 12:28:10 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-10-17 12:28:10 +0000
commitb2c261eeeefcd94c9c164fa1e8671b7b42997e4d (patch)
treecc5413af9fef7661c7e8d55db1d14a88d67e729a /os/hal/src
parenta708e083e1cf6f6181bcd02baf9cc580f38b5397 (diff)
downloadChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.tar.gz
ChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.tar.bz2
ChibiOS-b2c261eeeefcd94c9c164fa1e8671b7b42997e4d.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7411 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/icu.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/os/hal/src/icu.c b/os/hal/src/icu.c
index 9f7a6b6c6..481b8a6c6 100644
--- a/os/hal/src/icu.c
+++ b/os/hal/src/icu.c
@@ -136,15 +136,20 @@ void icuStartCapture(ICUDriver *icup) {
* @brief Waits for a completed capture.
* @note The operation could be performed in polled mode depending on.
* @note In order to use this function notifications must be disabled.
- * @pre The driver must be in @p ICU_WAITING or @p ICU_ACTIVE modes.
+ * @pre The driver must be in @p ICU_WAITING or @p ICU_ACTIVE states.
* @post After the capture is available the driver is in @p ICU_ACTIVE
- * mode.
+ * state. If a capture fails then the driver is in @p ICU_WAITING
+ * state.
*
* @param[in] icup pointer to the @p ICUDriver object
+ * @return The capture status.
+ * @retval false if the capture is successful.
+ * @retval true if a timer overflow occurred.
*
* @api
*/
-void icuWaitCapture(ICUDriver *icup) {
+bool icuWaitCapture(ICUDriver *icup) {
+ bool result;
osalDbgCheck(icup != NULL);
@@ -153,9 +158,11 @@ void icuWaitCapture(ICUDriver *icup) {
"invalid state");
osalDbgAssert(icuAreNotificationsEnabledX(icup) == false,
"notifications enabled");
- icu_lld_wait_capture(icup);
- icup->state = ICU_ACTIVE;
+ result = icu_lld_wait_capture(icup);
+ icup->state = result ? ICU_WAITING : ICU_ACTIVE;
osalSysUnlock();
+
+ return result;
}
/**