stmhal: Allow network, uselect, usocket mods to be used by other ports.
Remove include of stm32f4xx_hal.h, replace by include of MICROPY_HAL_H where needed, and make it compile without float support. This makes these 3 modules much more generic and usable by other ports.
This commit is contained in:
parent
1f8a2f6623
commit
d0caaadaee
@ -29,8 +29,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "stm32f4xx_hal.h"
|
|
||||||
|
|
||||||
#include "mpconfig.h"
|
#include "mpconfig.h"
|
||||||
#include "nlr.h"
|
#include "nlr.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
@ -28,8 +28,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "stm32f4xx_hal.h"
|
|
||||||
|
|
||||||
#include "mpconfig.h"
|
#include "mpconfig.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "nlr.h"
|
#include "nlr.h"
|
||||||
@ -37,6 +35,7 @@
|
|||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
#include "objlist.h"
|
#include "objlist.h"
|
||||||
#include "pybioctl.h"
|
#include "pybioctl.h"
|
||||||
|
#include MICROPY_HAL_H
|
||||||
|
|
||||||
/// \module select - Provides select function to wait for events on a stream
|
/// \module select - Provides select function to wait for events on a stream
|
||||||
///
|
///
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "stm32f4xx_hal.h"
|
|
||||||
|
|
||||||
#include "mpconfig.h"
|
#include "mpconfig.h"
|
||||||
#include "nlr.h"
|
#include "nlr.h"
|
||||||
#include "misc.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) {
|
if (timeout_in == mp_const_none) {
|
||||||
timeout = -1;
|
timeout = -1;
|
||||||
} else {
|
} else {
|
||||||
|
#if MICROPY_PY_BUILTIN_FLOAT
|
||||||
timeout = 1000 * mp_obj_get_float(timeout_in);
|
timeout = 1000 * mp_obj_get_float(timeout_in);
|
||||||
|
#else
|
||||||
|
timeout = 1000 * mp_obj_get_int(timeout_in);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
int _errno;
|
int _errno;
|
||||||
if (self->nic_type->settimeout(self, timeout, &_errno) != 0) {
|
if (self->nic_type->settimeout(self, timeout, &_errno) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user