From 231e9b7cb76a137c211af00bc845ec37b5f1fef7 Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Wed, 21 Oct 2026 14:59:25 -0500 Subject: [PATCH] audiograph on CircuitPython: go through void * for the output block's int16 pointer CircuitPython's ESP32 builds compile with -Werror=cast-align, and the cast from a byte pointer to int16_t * stopped the build. The offset is a whole number of int16 blocks into an int16 buffer, so the pointer is aligned; the cast now says so. Nothing else changes. --- src/circuitpython_spike/shared-bindings/audiograph/Graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/circuitpython_spike/shared-bindings/audiograph/Graph.c b/src/circuitpython_spike/shared-bindings/audiograph/Graph.c index 81ff85e..384474c 100644 --- a/src/circuitpython_spike/shared-bindings/audiograph/Graph.c +++ b/src/circuitpython_spike/shared-bindings/audiograph/Graph.c @@ -248,7 +248,7 @@ static mp_obj_t audiograph_graph_run(size_t n_args, const mp_obj_t *args) { if (block < 0 || (size_t)(block + 1) * block_bytes > info.len) { mp_raise_ValueError(MP_ERROR_TEXT("out is too small for that block")); } - out = (int16_t *)((uint8_t *)info.buf + (size_t)block * block_bytes); + out = (int16_t *)(void *)((uint8_t *)info.buf + (size_t)block * block_bytes); } uint32_t enable = 0xFFFFFFFFu; if (n_args > 3) {