summaryrefslogtreecommitdiff
path: root/bsp/allwinner/libraries/sunxi-hal/hal/test/thermal/test_thermal.c
blob: 564a8d44fa44d482bbc5ef35b139cfc6400c57b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <stdlib.h>

#include <hal_cmd.h>
#include <sunxi_hal_thermal.h>
#include <hal_timer.h>

int cmd_ths_gt(int argc, char **argv)
{
    int ret, temp, i;
    static int init = 0;

    if (!init) {
        hal_ths_init();
        init = 1;
        hal_msleep(1000);
    }

    printf("ths get temp\n");

    ret = hal_ths_get_temp(0, &temp);
    if (ret < 0)
        printf("Fail to get temp.\n");
    else
        printf("\ntemp:%d\n", temp);

    return 0;
}

FINSH_FUNCTION_EXPORT_CMD(cmd_ths_gt, ths_gt, thermal get temp)