extmod: Add and reorganise compilation guards and includes.
To reduce dependencies on header files when extmod components are disabled. Signed-off-by: Damien George <damien.p.george@gmail.com>
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "py/runtime.h"
|
||||
|
||||
#if MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_SOFTSPI
|
||||
|
||||
#include "extmod/machine_spi.h"
|
||||
|
||||
// if a port didn't define MSB/LSB constants then provide them
|
||||
@@ -39,8 +42,6 @@
|
||||
/******************************************************************************/
|
||||
// MicroPython bindings for generic machine.SPI
|
||||
|
||||
#if MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_SOFTSPI
|
||||
|
||||
STATIC mp_obj_t machine_spi_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
|
||||
mp_obj_base_t *s = (mp_obj_base_t *)MP_OBJ_TO_PTR(args[0]);
|
||||
mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t *)MP_OBJ_TYPE_GET_SLOT(s->type, protocol);
|
||||
|
||||
Reference in New Issue
Block a user