From 9340a7bf1e352175b066b3f44495c373545fb65b Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:15:38 +0100 Subject: [PATCH 1/7] Fix variable used in DEBUG mode being commented out to avoid warnings --- src/Primitives/emulated.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Primitives/emulated.cpp b/src/Primitives/emulated.cpp index 1b2c2345..b003a6f1 100644 --- a/src/Primitives/emulated.cpp +++ b/src/Primitives/emulated.cpp @@ -462,7 +462,7 @@ def_prim(write_spi_bytes_16, twoToNoneU32) { def_prim(subscribe_interrupt, threeToNoneU32) { uint8_t pin = arg2.uint32; // GPIOPin uint8_t tidx = arg1.uint32; // Table Idx pointing to Callback function - // uint8_t mode = arg0.uint32; // never used in emulator + [[maybe_unused]] uint8_t mode = arg0.uint32; // never used in emulator debug("EMU: subscribe_interrupt(%u, %u, %u) \n", pin, tidx, mode); From ad8dd77e4d350e9d8c8cc3c8c13ca3e5079d3afb Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:16:21 +0100 Subject: [PATCH 2/7] Remove unnecessary include that causes issues --- src/Primitives/zephyr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Primitives/zephyr.cpp b/src/Primitives/zephyr.cpp index d7273b0d..638cba24 100644 --- a/src/Primitives/zephyr.cpp +++ b/src/Primitives/zephyr.cpp @@ -1,4 +1,3 @@ -#include #ifndef ARDUINO /** From 380b19df9a18e8addebde680fd13f27d0fd67644 Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:17:41 +0100 Subject: [PATCH 3/7] Fix pim_index typo --- src/Primitives/emulated.cpp | 2 +- src/Primitives/idf.cpp | 2 +- src/Primitives/zephyr.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Primitives/emulated.cpp b/src/Primitives/emulated.cpp index b003a6f1..93cf2787 100644 --- a/src/Primitives/emulated.cpp +++ b/src/Primitives/emulated.cpp @@ -50,7 +50,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("pim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } diff --git a/src/Primitives/idf.cpp b/src/Primitives/idf.cpp index 35873c5d..5f96db63 100644 --- a/src/Primitives/idf.cpp +++ b/src/Primitives/idf.cpp @@ -51,7 +51,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("pim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } diff --git a/src/Primitives/zephyr.cpp b/src/Primitives/zephyr.cpp index 638cba24..e6d32310 100644 --- a/src/Primitives/zephyr.cpp +++ b/src/Primitives/zephyr.cpp @@ -53,7 +53,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("pim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } From be8a79ca73810c280319ddb52ef8e650630ae11f Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:20:47 +0100 Subject: [PATCH 4/7] Updated comment next to variable --- src/Primitives/emulated.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Primitives/emulated.cpp b/src/Primitives/emulated.cpp index 93cf2787..0f7af9f1 100644 --- a/src/Primitives/emulated.cpp +++ b/src/Primitives/emulated.cpp @@ -462,7 +462,7 @@ def_prim(write_spi_bytes_16, twoToNoneU32) { def_prim(subscribe_interrupt, threeToNoneU32) { uint8_t pin = arg2.uint32; // GPIOPin uint8_t tidx = arg1.uint32; // Table Idx pointing to Callback function - [[maybe_unused]] uint8_t mode = arg0.uint32; // never used in emulator + [[maybe_unused]] uint8_t mode = arg0.uint32; // Not used by emulator only printed debug("EMU: subscribe_interrupt(%u, %u, %u) \n", pin, tidx, mode); From a4b88bb82ead2318a65028d76e4076858d678ea0 Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:21:22 +0100 Subject: [PATCH 5/7] Also fix typo on the Arduino platform --- src/Primitives/arduino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Primitives/arduino.cpp b/src/Primitives/arduino.cpp index cd7983b9..4ad2f6d9 100644 --- a/src/Primitives/arduino.cpp +++ b/src/Primitives/arduino.cpp @@ -153,7 +153,7 @@ int prim_index = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("pim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } From 893ed070e13f52e100e40115533d4b6a16413db4 Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:25:31 +0100 Subject: [PATCH 6/7] Fix formatting --- src/Primitives/arduino.cpp | 2 +- src/Primitives/emulated.cpp | 7 ++++--- src/Primitives/idf.cpp | 2 +- src/Primitives/zephyr.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Primitives/arduino.cpp b/src/Primitives/arduino.cpp index 4ad2f6d9..f0f50e5e 100644 --- a/src/Primitives/arduino.cpp +++ b/src/Primitives/arduino.cpp @@ -153,7 +153,7 @@ int prim_index = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("prim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } diff --git a/src/Primitives/emulated.cpp b/src/Primitives/emulated.cpp index 0f7af9f1..28548ae0 100644 --- a/src/Primitives/emulated.cpp +++ b/src/Primitives/emulated.cpp @@ -50,7 +50,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("prim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } @@ -394,7 +394,7 @@ def_prim(chip_pin_mode, twoToNoneU32) { } def_prim(chip_digital_write, twoToNoneU32) { - debug("EMU: chip_digital_write(%u,%u) \n", arg1.uint32, arg0.uint32); + printf("EMU: chip_digital_write(%u,%u) \n", arg1.uint32, arg0.uint32); pop_args(2); return true; } @@ -462,7 +462,8 @@ def_prim(write_spi_bytes_16, twoToNoneU32) { def_prim(subscribe_interrupt, threeToNoneU32) { uint8_t pin = arg2.uint32; // GPIOPin uint8_t tidx = arg1.uint32; // Table Idx pointing to Callback function - [[maybe_unused]] uint8_t mode = arg0.uint32; // Not used by emulator only printed + [[maybe_unused]] uint8_t mode = + arg0.uint32; // Not used by emulator only printed debug("EMU: subscribe_interrupt(%u, %u, %u) \n", pin, tidx, mode); diff --git a/src/Primitives/idf.cpp b/src/Primitives/idf.cpp index 5f96db63..fb04e7f0 100644 --- a/src/Primitives/idf.cpp +++ b/src/Primitives/idf.cpp @@ -51,7 +51,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("prim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } diff --git a/src/Primitives/zephyr.cpp b/src/Primitives/zephyr.cpp index e6d32310..0d722675 100644 --- a/src/Primitives/zephyr.cpp +++ b/src/Primitives/zephyr.cpp @@ -53,7 +53,7 @@ double sensor_emu = 0; p->f_reverse = nullptr; \ p->f_serialize_state = nullptr; \ } else { \ - FATAL("prim_index out of bounds"); \ + FATAL("prim_index out of bounds"); \ } \ } From fd88a0e917af628a289aa4da7163421ad6c15810 Mon Sep 17 00:00:00 2001 From: MaartenS11 Date: Thu, 16 Jan 2025 17:45:45 +0100 Subject: [PATCH 7/7] Fix missing type uint32_t error --- tests/unit/shared/serialisation.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/shared/serialisation.h b/tests/unit/shared/serialisation.h index e49a8652..1417646a 100644 --- a/tests/unit/shared/serialisation.h +++ b/tests/unit/shared/serialisation.h @@ -1,4 +1,5 @@ #pragma once +#include #include class Serialiser {