diff --git a/ports/unix/modsocket.c b/ports/unix/modsocket.c index 737550b428..5c935d2299 100644 --- a/ports/unix/modsocket.c +++ b/ports/unix/modsocket.c @@ -25,6 +25,10 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" + +#if MICROPY_PY_SOCKET + #include #include #include @@ -49,8 +53,6 @@ #include "extmod/vfs.h" #include -#if MICROPY_PY_SOCKET - /* The idea of this module is to implement reasonable minimum of socket-related functions to write typical clients and servers. diff --git a/ports/unix/modtermios.c b/ports/unix/modtermios.c index 4f9751e274..8a79bc3a59 100644 --- a/ports/unix/modtermios.c +++ b/ports/unix/modtermios.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#if MICROPY_PY_TERMIOS + #include #include #include @@ -33,8 +35,6 @@ #include "py/runtime.h" #include "py/mphal.h" -#if MICROPY_PY_TERMIOS - STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) { struct termios term; int fd = mp_obj_get_int(fd_in); diff --git a/ports/unix/mpbtstackport_h4.c b/ports/unix/mpbtstackport_h4.c index dacfff9a49..a2038c16a9 100644 --- a/ports/unix/mpbtstackport_h4.c +++ b/ports/unix/mpbtstackport_h4.c @@ -24,14 +24,16 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" + +#if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK && MICROPY_BLUETOOTH_BTSTACK_H4 + #include #include "py/runtime.h" #include "py/mperrno.h" #include "py/mphal.h" -#if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK && MICROPY_BLUETOOTH_BTSTACK_H4 - #include "lib/btstack/src/hci_transport_h4.h" #include "lib/btstack/chipset/zephyr/btstack_chipset_zephyr.h" diff --git a/ports/unix/mpbtstackport_usb.c b/ports/unix/mpbtstackport_usb.c index b8c7b758d9..1793e2bacd 100644 --- a/ports/unix/mpbtstackport_usb.c +++ b/ports/unix/mpbtstackport_usb.c @@ -24,6 +24,10 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" + +#if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK && MICROPY_BLUETOOTH_BTSTACK_USB + #include #include @@ -31,8 +35,6 @@ #include "py/mperrno.h" #include "py/mphal.h" -#if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK && MICROPY_BLUETOOTH_BTSTACK_USB - #include "lib/btstack/src/btstack.h" #include "lib/btstack/src/hci_transport_usb.h" #include "lib/btstack/platform/embedded/btstack_run_loop_embedded.h"