Skip to content

Commit

Permalink
Make message buffer static
Browse files Browse the repository at this point in the history
Now that the message max size is 256k, do not put the buffer on the
stack.
  • Loading branch information
rom1v committed Jun 11, 2020
1 parent 488d22d commit 1e4ee54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/src/receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (;;) {
Expand Down

0 comments on commit 1e4ee54

Please sign in to comment.