aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authortheShed <theShed@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-05 15:04:49 +0000
committertheShed <theShed@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-05 15:04:49 +0000
commit9986b28b99c257afb7eb5666ca30513c461f1c53 (patch)
tree030ee6e0043415c15b0c901be656eff0a3b77e74 /os/hal
parentc86a83d45a588d43c7a0fa546c581b166a952540 (diff)
downloadChibiOS-9986b28b99c257afb7eb5666ca30513c461f1c53.tar.gz
ChibiOS-9986b28b99c257afb7eb5666ca30513c461f1c53.tar.bz2
ChibiOS-9986b28b99c257afb7eb5666ca30513c461f1c53.zip
LPC8xx: add gpt_lld_change_interval()
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5546 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/platforms/LPC8xx/gpt_lld.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/os/hal/platforms/LPC8xx/gpt_lld.h b/os/hal/platforms/LPC8xx/gpt_lld.h
index 228678654..73f080f66 100644
--- a/os/hal/platforms/LPC8xx/gpt_lld.h
+++ b/os/hal/platforms/LPC8xx/gpt_lld.h
@@ -152,6 +152,22 @@ struct GPTDriver {
/* Driver macros. */
/*===========================================================================*/
+/**
+ * @brief Changes the interval of GPT peripheral.
+ * @details This function changes the interval of a running GPT unit.
+ * @pre The GPT unit must have been activated using @p gptStart().
+ * @pre The GPT unit must have been running in continuous mode using
+ * @p gptStartContinuous().
+ * @post The GPT unit interval is changed to the new value.
+ * @note The function has effect at the next cycle start.
+ *
+ * @param[in] gptp pointer to a @p GPTDriver object
+ * @param[in] interval new cycle time in timer ticks
+ * @notapi
+ */
+#define gpt_lld_change_interval(gptp, interval) \
+ ((gptp)->tmr->INTVAL = ((interval*(gptp)->pr) - 1))
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/