From 1e4ee547b560ad3c52ce33fd32cf1b10b3d24d1a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 4 Jun 2020 23:50:08 +0200 Subject: [PATCH] Make message buffer static Now that the message max size is 256k, do not put the buffer on the stack. --- app/src/controller.c | 2 +- app/src/receiver.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/controller.c b/app/src/controller.c index b68b886b..c5897e5d 100644 --- a/app/src/controller.c +++ b/app/src/controller.c @@ -60,7 +60,7 @@ controller_push_msg(struct controller *controller, static bool process_msg(struct controller *controller, const struct control_msg *msg) { - unsigned char serialized_msg[CONTROL_MSG_MAX_SIZE]; + static unsigned char serialized_msg[CONTROL_MSG_MAX_SIZE]; int length = control_msg_serialize(msg, serialized_msg); if (!length) { return false; diff --git a/app/src/receiver.c b/app/src/receiver.c index bfe9d6e9..5ecff3b7 100644 --- a/app/src/receiver.c +++ b/app/src/receiver.c @@ -60,7 +60,7 @@ static int run_receiver(void *data) { struct receiver *receiver = data; - unsigned char buf[DEVICE_MSG_MAX_SIZE]; + static unsigned char buf[DEVICE_MSG_MAX_SIZE]; size_t head = 0; for (;;) {