static void dispatch(const MessagesMap_t *entry, uint8_t *msg, uint32_t msg_size)
{
    static uint8_t decode_buffer[MAX_DECODE_SIZE] __attribute__((aligned(4)));
    memset(decode_buffer, 0, sizeof(decode_buffer));

    if (!pb_parse(entry, msg, msg_size, decode_buffer)) {
        (*msg_failure)(FailureType_Failure_UnexpectedMessage,
                       "Could not parse protocol buffer message");
        return;
    }

    if (!entry->process_func) {
        (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Unexpected message");
        return;
    }

    entry->process_func(decode_buffer);
}
static void dispatch(const MessagesMap_t *entry, uint8_t *msg, uint32_t msg_size)
{
    static uint8_t decode_buffer[MAX_DECODE_SIZE] __attribute__((aligned(4)));
    memset(decode_buffer, 0, sizeof(decode_buffer));

    if (!pb_parse(entry, msg, msg_size, decode_buffer)) {
        (*msg_failure)(FailureType_Failure_UnexpectedMessage,
                       "Could not parse protocol buffer message");
        return;
    }

    if (!entry->process_func) {
        (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Unexpected message");
        return;
    }

    entry->process_func(decode_buffer);
}