From 01f4e85f1b360d40f8db99aa0db158fa5c2d796e Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 21 Feb 2024 12:00:41 +1100 Subject: [PATCH] extmod/modmachine: Remove MICROPY_PY_MACHINE guard from header. So this header file can expose declarations for contents of the `machine` module even if that module is disabled. Other parts of the system -- or third-party code -- may need these declarations, for example when a single component like MICROPY_PY_MACHINE_UART is enabled with MICROPY_PY_MACHINE disabled. Signed-off-by: Damien George --- extmod/modmachine.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extmod/modmachine.h b/extmod/modmachine.h index d186ce6615..e6b08b3fc9 100644 --- a/extmod/modmachine.h +++ b/extmod/modmachine.h @@ -30,9 +30,9 @@ #include "py/mphal.h" #include "py/obj.h" -#if MICROPY_PY_MACHINE - +#if MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_SOFTSPI #include "drivers/bus/spi.h" +#endif // Whether to enable the ADC.init() method. // Requires a port to implement mp_machine_adc_init_helper(). @@ -264,6 +264,4 @@ MP_DECLARE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj); MP_DECLARE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj); #endif -#endif // MICROPY_PY_MACHINE - #endif // MICROPY_INCLUDED_EXTMOD_MODMACHINE_H