summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-23 23:52:09 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-23 23:52:09 +0000
commit056abbcf31a8b191ba2369afbeb93e2c74bbaa65 (patch)
tree8e4a05ef1b57b2607a3ef7fc6dd3805d131cefa1
parent86aa16bea61da8a8d156a7a928902a0bf4c85b73 (diff)
stmhal: Fix unused variables when HW_CLK_LAST_FREQ not defined.
-rw-r--r--stmhal/modmachine.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c
index 25977e789..7b2c1b685 100644
--- a/stmhal/modmachine.c
+++ b/stmhal/modmachine.c
@@ -282,9 +282,11 @@ STATIC mp_obj_t machine_freq(mp_uint_t n_args, const mp_obj_t *args) {
} else {
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
}
+ #if defined(MICROPY_HW_CLK_LAST_FREQ) && MICROPY_HW_CLK_LAST_FREQ
uint32_t h = RCC_ClkInitStruct.AHBCLKDivider >> 4;
uint32_t b1 = RCC_ClkInitStruct.APB1CLKDivider >> 10;
uint32_t b2 = RCC_ClkInitStruct.APB2CLKDivider >> 10;
+ #endif
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
goto fail;
}