#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

#include "./SYSTEM/sys/sys.h"

#include "./hmi/hmi_cmd.h"
#include "./hmi/hmi_rx_parse.h"
#include "./hmi/hmi_hex_parse.h"

#include "./hmi_slider_example.h"

void hmi_slider_example_hex_cmd(struct hex_cmd_fmt *fram)
{
    uint8_t wid_id = fram->func;
    cmd_res_t *back = hmi_cmd_back_res();
    bool res = false;
    if (!wid_id)
    {
        res = API_GET(sl0.val);
        if (!res)
        {
            printf("get err!");
        }
        back = hmi_cmd_back_res();
        TIM3->CCR2 = back->val.value;
    }
    else if (wid_id)
    {
        res = API_GET(csl0.val);
        if (!res)
        {
            printf("get err!");
        }
        back = hmi_cmd_back_res();
        TIM3->CCR2 = back->val.value;
    }
}

void hmi_slider_example_timer_update_50ms(uint16_t page_id)
{
    if (page_id != 3)
        return;
}
