ecf2d82159
* Synchronize the code of the rt mart branch to the master branch. * TTY device * Add lwP code from rt-smart * Add vnode in DFS, but DFS will be re-write for rt-smart * There are three libcpu for rt-smart: * arm/cortex-a, arm/aarch64 * riscv64 Co-authored-by: Rbb666 <zhangbingru@rt-thread.com> Co-authored-by: zhkag <zhkag@foxmail.com>
32 lines
550 B
C
32 lines
550 B
C
#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)
|
|
|