aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-18 16:11:57 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-18 16:11:57 +0200
commitc1007f50de3ad7284d4a1afa6bfb3b6e427c3556 (patch)
tree37b6d0fca12343640bd497b3ad17c2d69842a529
parent1e54994000d1c26e9cbd724b76da5ceb273f9cbb (diff)
stupid dumb bug
-rw-r--r--lib/pbdrv/pb-msg.c7
-rw-r--r--puzzle/dummy/main.cpp13
2 files changed, 4 insertions, 16 deletions
diff --git a/lib/pbdrv/pb-msg.c b/lib/pbdrv/pb-msg.c
index 8cf020c..1d7f90b 100644
--- a/lib/pbdrv/pb-msg.c
+++ b/lib/pbdrv/pb-msg.c
@@ -11,6 +11,7 @@ pb_buf_t pb_msg_write(const pb_msg_t * msg) {
buf.data = pb_malloc(MPACK_BUFFER_SIZE);
if (buf.data == NULL) return buf;
+ buf.size = MPACK_BUFFER_SIZE;
mpack_writer_t writer;
mpack_writer_init(&writer, buf.data, buf.size);
@@ -18,11 +19,7 @@ pb_buf_t pb_msg_write(const pb_msg_t * msg) {
pb_ser_w(&writer, msg);
buf.size = mpack_writer_buffer_used(&writer);
- if (mpack_writer_destroy(&writer) != mpack_ok) {
- pb_free(buf.data);
- buf.data = NULL;
- buf.size = 0;
- }
+ mpack_writer_destroy(&writer);
return buf;
}
diff --git a/puzzle/dummy/main.cpp b/puzzle/dummy/main.cpp
index 41d8993..d611014 100644
--- a/puzzle/dummy/main.cpp
+++ b/puzzle/dummy/main.cpp
@@ -1,14 +1,5 @@
#include <Arduino.h>
-#include <FreeRTOS.h>
-#include <task.h>
-
-void setup() {
- Serial.begin(115200);
-}
-
-void loop() {
- Serial.write(".");
- vTaskDelay(1000 / portTICK_PERIOD_MS);
-}
+void setup() { }
+void loop() { }