aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/pb-route.c
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-21 10:56:20 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-21 10:56:20 +0200
commit6da66e5356eb367e4b766484eab3a94cb009fb9c (patch)
treedb8e172ccc26a419f45afbb699941eb7990ba839 /lib/pbdrv/pb-route.c
parent349db1098e7a7d6f08352dcb7dc5207aae49257c (diff)
fix dumb mistake in pbdrv
Diffstat (limited to 'lib/pbdrv/pb-route.c')
-rw-r--r--lib/pbdrv/pb-route.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pbdrv/pb-route.c b/lib/pbdrv/pb-route.c
index df00cd3..709fb7f 100644
--- a/lib/pbdrv/pb-route.c
+++ b/lib/pbdrv/pb-route.c
@@ -64,9 +64,6 @@ __weak void pb_hook_module_init() {
}
__weak void pb_route_cmd_state_req(pb_msg_t * msg) {
pb_global_state_t own_state = pb_hook_mod_state_read();
- pb_buf_t buf = pb_send_state_res(own_state);
- pb_send_reply(msg, &buf);
- pb_buf_free(&buf);
// notify of new global state variable
pb_cmd_state_t * cmd = msg->cmd;
@@ -76,6 +73,10 @@ __weak void pb_route_cmd_state_req(pb_msg_t * msg) {
pb_hook_main_state_update(cmd->state);
}
_main_state = cmd->state;
+
+ pb_buf_t buf = pb_send_state_res();
+ pb_send_reply(msg, &buf);
+ pb_buf_free(&buf);
}
__weak void pb_route_cmd_state_res(pb_msg_t * msg) {}