summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/modusocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/modusocket.c')
-rw-r--r--stmhal/modusocket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c
index d705636c1a..c2246b3c4d 100644
--- a/stmhal/modusocket.c
+++ b/stmhal/modusocket.c
@@ -29,8 +29,6 @@
#include <string.h>
#include <errno.h>
-#include "stm32f4xx_hal.h"
-
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"
@@ -321,7 +319,11 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
if (timeout_in == mp_const_none) {
timeout = -1;
} else {
+ #if MICROPY_PY_BUILTIN_FLOAT
timeout = 1000 * mp_obj_get_float(timeout_in);
+ #else
+ timeout = 1000 * mp_obj_get_int(timeout_in);
+ #endif
}
int _errno;
if (self->nic_type->settimeout(self, timeout, &_errno) != 0) {