diff options
| author | Damien George | 2014-09-29 12:18:48 +0100 |
|---|---|---|
| committer | Damien George | 2014-09-29 12:18:48 +0100 |
| commit | bf683e6b323b3ebab3be2fd65c24c8a65698124d (patch) | |
| tree | d0a3eadd0fc0296fa9a9dcd551629794fe88b11c /stmhal/modselect.c | |
| parent | f90b59e61035c194470b7de589cfc3b44484b1fe (diff) | |
| parent | 39296b40d49b4b6b9373a80de67e017e540f1408 (diff) | |
Merge pull request #877 from dhylands/timer-overflow
Fix timer overflow code.
Diffstat (limited to 'stmhal/modselect.c')
| -rw-r--r-- | stmhal/modselect.c | 4 |
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 } } |
