Skip to content

Commit

Permalink
STM32 wdg: Remove use of float
Browse files Browse the repository at this point in the history
Using int avoids pulling in several kilobytes of float math code.

Signed-off-by: Björn Stenberg <[email protected]>
  • Loading branch information
zagor authored and galak committed Sep 12, 2019
1 parent 0951ce2 commit b6454d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/watchdog/wdt_iwdg_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void iwdg_stm32_convert_timeout(u32_t timeout,
u8_t shift = 0U;

/* Convert timeout to seconds. */
float m_timeout = (float)timeout / 1000000 * LSI_VALUE;
u32_t m_timeout = (u64_t)timeout * LSI_VALUE / 1000000;

do {
divider = 4 << shift;
Expand Down

0 comments on commit b6454d5

Please sign in to comment.