summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaureen Helm <maureen.helm@analog.com>2023-08-30 16:49:40 -0500
committerDamien George <damien@micropython.org>2024-10-02 07:49:53 +1000
commite191265f7f71862ccc5634797c60f443511752f1 (patch)
treef2b25fc518c16c7d521f8cc380939f0d541884f0
parenta7ae3a385e0c394445d109bd967b0d90a4fe92e7 (diff)
zephyr: Change SPI chip select from a pointer to a struct member.
Zephyr v3.4.0 changed the SPI chip select from a pointer to a struct member to allow using the existing SPI dt-spec macros in C++. Signed-off-by: Maureen Helm <maureen.helm@analog.com>
-rw-r--r--ports/zephyr/machine_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/zephyr/machine_spi.c b/ports/zephyr/machine_spi.c
index 2474f2bb8..80bfa2e54 100644
--- a/ports/zephyr/machine_spi.c
+++ b/ports/zephyr/machine_spi.c
@@ -102,7 +102,7 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz
args[ARG_bits].u_int << 5 |
SPI_LINES_SINGLE),
.slave = 0,
- .cs = NULL
+ .cs = {},
};
machine_hard_spi_obj_t *self = mp_obj_malloc(machine_hard_spi_obj_t, &machine_spi_type);
@@ -157,7 +157,7 @@ static void machine_hard_spi_init(mp_obj_base_t *obj, size_t n_args, const mp_ob
.frequency = baudrate,
.operation = operation,
.slave = 0,
- .cs = NULL
+ .cs = {},
};
self->config = cfg;