aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal')
-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;
};
/*===========================================================================*/