aboutsummaryrefslogtreecommitdiff
path: root/stmhal/modselect.c
diff options
context:
space:
mode:
authorDamien George2014-09-29 12:18:48 +0100
committerDamien George2014-09-29 12:18:48 +0100
commitbf683e6b323b3ebab3be2fd65c24c8a65698124d (patch)
treed0a3eadd0fc0296fa9a9dcd551629794fe88b11c /stmhal/modselect.c
parentf90b59e61035c194470b7de589cfc3b44484b1fe (diff)
parent39296b40d49b4b6b9373a80de67e017e540f1408 (diff)
Merge pull request #877 from dhylands/timer-overflow
Fix timer overflow code.
Diffstat (limited to 'stmhal/modselect.c')
-rw-r--r--stmhal/modselect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stmhal/modselect.c b/stmhal/modselect.c
index bad535f21..a84c94554 100644
--- a/stmhal/modselect.c
+++ b/stmhal/modselect.c
@@ -124,10 +124,14 @@ STATIC mp_obj_t select_select(uint n_args, const mp_obj_t *args) {
mp_uint_t timeout = -1;
if (n_args == 4) {
if (args[3] != mp_const_none) {
+ #if MICROPY_PY_BUILTINS_FLOAT
float timeout_f = mp_obj_get_float(args[3]);
if (timeout_f >= 0) {
timeout = (mp_uint_t)(timeout_f * 1000);
}
+ #else
+ timeout = mp_obj_get_int(args[3]) * 1000;
+ #endif
}
}