diff options
| -rw-r--r-- | ports/stm32/machine_spi.c | 4 | ||||
| -rw-r--r-- | ports/stm32/pyb_spi.c | 4 | ||||
| -rw-r--r-- | ports/stm32/spi.c | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/ports/stm32/machine_spi.c b/ports/stm32/machine_spi.c index b916252da..0a5a67ef2 100644 --- a/ports/stm32/machine_spi.c +++ b/ports/stm32/machine_spi.c @@ -28,6 +28,8 @@ #include "extmod/modmachine.h" #include "spi.h" +#if MICROPY_PY_MACHINE_SPI + /******************************************************************************/ // Implementation of hard SPI for machine module @@ -150,3 +152,5 @@ MP_DEFINE_CONST_OBJ_TYPE( protocol, &machine_hard_spi_p, locals_dict, &mp_machine_spi_locals_dict ); + +#endif // MICROPY_PY_MACHINE_SPI diff --git a/ports/stm32/pyb_spi.c b/ports/stm32/pyb_spi.c index f36c04874..f92642ddd 100644 --- a/ports/stm32/pyb_spi.c +++ b/ports/stm32/pyb_spi.c @@ -29,6 +29,8 @@ #include "bufhelper.h" #include "spi.h" +#if MICROPY_PY_PYB + /******************************************************************************/ // MicroPython bindings for legacy pyb API @@ -362,3 +364,5 @@ MP_DEFINE_CONST_OBJ_TYPE( protocol, &pyb_spi_p, locals_dict, &pyb_spi_locals_dict ); + +#endif // MICROPY_PY_PYB diff --git a/ports/stm32/spi.c b/ports/stm32/spi.c index ee2301c80..df71efd3f 100644 --- a/ports/stm32/spi.c +++ b/ports/stm32/spi.c @@ -735,6 +735,8 @@ void spi_print(const mp_print_t *print, const spi_t *spi_obj, bool legacy) { mp_print_str(print, ")"); } +#if MICROPY_PY_MACHINE_SPI + const spi_t *spi_from_mp_obj(mp_obj_t o) { if (mp_obj_is_type(o, &pyb_spi_type)) { pyb_spi_obj_t *self = MP_OBJ_TO_PTR(o); @@ -761,6 +763,8 @@ mp_obj_base_t *mp_hal_get_spi_obj(mp_obj_t o) { } } +#endif + /******************************************************************************/ // Implementation of low-level SPI C protocol |
