|
...
|
...
|
@@ -5,6 +5,13 @@ |
|
|
|
#include "JZ_TempControl.h"
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "version_choose.h"
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <time.h>
|
|
|
|
#if SPECIAL_VERSION == SPECIAL_GDU
|
|
|
|
#include "test_widget.h"
|
|
|
|
#include "gdu_logger.h"
|
|
|
|
#endif
|
|
|
|
/* Private constants ---------------------------------------------------------*/
|
|
|
|
|
|
|
|
/* Private types -------------------------------------------------------------*/
|
|
...
|
...
|
@@ -229,4 +236,57 @@ void JZ_DelayThreadCreate(int delayTime) |
|
|
|
printf("线程创建失败\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
|
|
\ No newline at end of file |
|
|
|
}
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
*设置UI控件值
|
|
|
|
*函数名: Jz_set_widget_value
|
|
|
|
*函数参数:
|
|
|
|
@index: 控件编号
|
|
|
|
@value: 控件值
|
|
|
|
*返回值:
|
|
|
|
*函数作者:wzy
|
|
|
|
*************************************/
|
|
|
|
void Jz_set_widget_value(int index,int value)
|
|
|
|
{
|
|
|
|
//如不是道通,则设置控件的值
|
|
|
|
#if SPECIAL_VERSION != SPECIAL_UAV
|
|
|
|
set_widget_value(index,value);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
*输出信息
|
|
|
|
*函数名: JZ_LOG_INFO
|
|
|
|
*函数参数:
|
|
|
|
|
|
|
|
*返回值:
|
|
|
|
*函数作者:wzy
|
|
|
|
*************************************/
|
|
|
|
void JZ_LOG_INFO(const char *format, ...)
|
|
|
|
{
|
|
|
|
#if SPECIAL_VERSION == SPECIAL_GDU
|
|
|
|
va_list args;
|
|
|
|
va_start(args, format);
|
|
|
|
USER_LOG_INFO(format, args); // 传递参数给 USER_LOG_INFO
|
|
|
|
va_end(args);
|
|
|
|
#else
|
|
|
|
FILE *file = fopen("/root/sdcard/debuglog.txt", "a"); // "a" 模式表示追加内容到文件末尾
|
|
|
|
if (file == NULL) {
|
|
|
|
perror("无法打开日志文件");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// 获取当前时间
|
|
|
|
time_t now;
|
|
|
|
time(&now);
|
|
|
|
struct tm *local = localtime(&now);
|
|
|
|
// 写入时间戳和消息到文件
|
|
|
|
fprintf(file, "[%04d-%02d-%02d %02d:%02d:%02d] %s\n",
|
|
|
|
local->tm_year + 1900, local->tm_mon + 1, local->tm_mday,
|
|
|
|
local->tm_hour, local->tm_min, local->tm_sec, format);
|
|
|
|
|
|
|
|
// 关闭文件
|
|
|
|
fclose(file);
|
|
|
|
#endif
|
|
|
|
} |
...
|
...
|
|