Skip to content

Commit

Permalink
extmod/modmachine: Remove MICROPY_PY_MACHINE guard from header.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dpgeorge committed Feb 21, 2024
1 parent 31e718a commit 01f4e85
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions extmod/modmachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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

0 comments on commit 01f4e85

Please sign in to comment.