aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-05-02 12:06:58 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-05-02 12:06:58 +0000
commit794c092a2aa7dfe3ca93a9ac5f5714855854553f (patch)
tree7263168ebb0bf90eb6b7de5d76b990e767e86f8e /os
parent51069d7c81a2320ffd487e5788e6bc48ede3f11a (diff)
downloadChibiOS-794c092a2aa7dfe3ca93a9ac5f5714855854553f.tar.gz
ChibiOS-794c092a2aa7dfe3ca93a9ac5f5714855854553f.tar.bz2
ChibiOS-794c092a2aa7dfe3ca93a9ac5f5714855854553f.zip
Fixed eTimer ICU driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5653 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c4
-rw-r--r--os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.h21
2 files changed, 12 insertions, 13 deletions
diff --git a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c
index da762432e..609be3c2f 100644
--- a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c
+++ b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.c
@@ -285,10 +285,10 @@ static void icu_lld_serve_interrupt(ICUDriver *icup) {
* @param[in] config the architecture-dependent ICU driver configuration
*/
static void spc5_icu_smod_init(ICUDriver *icup) {
- uint32_t psc = (icup->clock / icup->config->frequency);
+ uint32_t psc = (SPC5_ETIMER0_CLK / icup->config->frequency);
chDbgAssert((psc <= 0xFFFF) &&
- ((psc * icup->config->frequency) == icup->clock) &&
+ ((psc * icup->config->frequency) == SPC5_ETIMER0_CLK) &&
((psc == 1) || (psc == 2) || (psc == 4) ||
(psc == 8) || (psc == 16) || (psc == 32) ||
(psc == 64) || (psc == 128)),
diff --git a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.h b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.h
index 9ec046b13..1e07e7918 100644
--- a/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.h
+++ b/os/hal/platforms/SPC5xx/eTimer_v1/icu_lld.h
@@ -458,20 +458,19 @@ struct ICUDriver {
/**
* @brief Driver state.
*/
- icustate_t state;
- /**
- * @brief eTimer submodule number.
- */
- uint8_t smod_number;
+ icustate_t state;
/**
* @brief Current configuration data.
*/
- const ICUConfig *config;
+ const ICUConfig *config;
+#if defined(ICU_DRIVER_EXT_FIELDS)
+ ICU_DRIVER_EXT_FIELDS
+#endif
+ /* End of the mandatory fields.*/
/**
- * @brief Timer base clock.
+ * @brief eTimer submodule number.
*/
- uint32_t clock;
- /* End of the mandatory fields.*/
+ uint32_t smod_number;
/**
* @brief Pointer to the eTimerx registers block.
*/
@@ -479,11 +478,11 @@ struct ICUDriver {
/**
* @brief CCR register used for width capture.
*/
- volatile vuint16_t *wccrp;
+ volatile vuint16_t *wccrp;
/**
* @brief CCR register used for period capture.
*/
- volatile vuint16_t *pccrp;
+ volatile vuint16_t *pccrp;
};
/*===========================================================================*/