diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-28 13:39:56 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-28 13:39:56 +0000 |
commit | fc492c6d190610cc9537360edf44d6dc5d072a2c (patch) | |
tree | 53fb1786e058f872671fb3adca4e73c708716d54 /os/hal/src/gpt.c | |
parent | da23780899ae4b9ce1bbe0cb9109da1c87fe0fa1 (diff) | |
parent | 663214d0e6728d153fd4118324e69c75c574327c (diff) | |
download | ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.gz ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.bz2 ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.zip |
I2C. Merge code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/gpt.c')
-rw-r--r-- | os/hal/src/gpt.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/os/hal/src/gpt.c b/os/hal/src/gpt.c index e90a8911a..c677f5284 100644 --- a/os/hal/src/gpt.c +++ b/os/hal/src/gpt.c @@ -32,6 +32,10 @@ #if HAL_USE_GPT || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver local definitions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -137,8 +141,11 @@ void gptStartContinuous(GPTDriver *gptp, gptcnt_t interval) { */
void gptStartContinuousI(GPTDriver *gptp, gptcnt_t interval) {
+ chDbgCheckClassI();
+ chDbgCheck(gptp != NULL, "gptStartContinuousI");
chDbgAssert(gptp->state == GPT_READY,
"gptStartContinuousI(), #1", "invalid state");
+
gptp->state = GPT_CONTINUOUS;
gpt_lld_start_timer(gptp, interval);
}
@@ -168,8 +175,11 @@ void gptStartOneShot(GPTDriver *gptp, gptcnt_t interval) { */
void gptStartOneShotI(GPTDriver *gptp, gptcnt_t interval) {
+ chDbgCheckClassI();
+ chDbgCheck(gptp != NULL, "gptStartOneShotI");
chDbgAssert(gptp->state == GPT_READY,
"gptStartOneShotI(), #1", "invalid state");
+
gptp->state = GPT_ONESHOT;
gpt_lld_start_timer(gptp, interval);
}
@@ -197,9 +207,12 @@ void gptStopTimer(GPTDriver *gptp) { */
void gptStopTimerI(GPTDriver *gptp) {
+ chDbgCheckClassI();
+ chDbgCheck(gptp != NULL, "gptStopTimerI");
chDbgAssert((gptp->state == GPT_READY) || (gptp->state == GPT_CONTINUOUS) ||
(gptp->state == GPT_ONESHOT),
"gptStopTimerI(), #1", "invalid state");
+
gptp->state = GPT_READY;
gpt_lld_stop_timer(gptp);
}
@@ -220,6 +233,7 @@ void gptPolledDelay(GPTDriver *gptp, gptcnt_t interval) { chDbgAssert(gptp->state == GPT_READY,
"gptPolledDelay(), #1", "invalid state");
+
gptp->state = GPT_ONESHOT;
gpt_lld_polled_delay(gptp, interval);
}
|