feat: add log related files.
This commit is contained in:
1
LVGL.Simulator/.clang-format
Normal file
1
LVGL.Simulator/.clang-format
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DisFormate : true
|
||||||
5
LVGL.Simulator/.vscode/settings.json
vendored
5
LVGL.Simulator/.vscode/settings.json
vendored
@@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"scr_mgr.h": "c",
|
"scr_mgr.h": "c",
|
||||||
"gui_main_scr.h": "c"
|
"gui_main_scr.h": "c",
|
||||||
|
"stdio.h": "c",
|
||||||
|
"gui_log.h": "c",
|
||||||
|
"lvgl.h": "c"
|
||||||
},
|
},
|
||||||
"C_Cpp.errorSquiggles": "Disabled"
|
"C_Cpp.errorSquiggles": "Disabled"
|
||||||
}
|
}
|
||||||
@@ -55,6 +55,8 @@
|
|||||||
<ClCompile Include="LVGL.Simulator.cpp" />
|
<ClCompile Include="LVGL.Simulator.cpp" />
|
||||||
<ClCompile Include="lvgl_mydemo\data\dataModel.c" />
|
<ClCompile Include="lvgl_mydemo\data\dataModel.c" />
|
||||||
<ClCompile Include="lvgl_mydemo\data\scr_mgr.c" />
|
<ClCompile Include="lvgl_mydemo\data\scr_mgr.c" />
|
||||||
|
<ClCompile Include="lvgl_mydemo\log\drv_log.c" />
|
||||||
|
<ClCompile Include="lvgl_mydemo\log\gui_log.c" />
|
||||||
<ClCompile Include="lvgl_mydemo\lvgl_app.c" />
|
<ClCompile Include="lvgl_mydemo\lvgl_app.c" />
|
||||||
<ClCompile Include="lvgl_mydemo\screen\gui_main_scr.c" />
|
<ClCompile Include="lvgl_mydemo\screen\gui_main_scr.c" />
|
||||||
<ClCompile Include="lvgl_mydemo\screen\gui_scr_mgr.c" />
|
<ClCompile Include="lvgl_mydemo\screen\gui_scr_mgr.c" />
|
||||||
|
|||||||
@@ -48,6 +48,12 @@
|
|||||||
<ClCompile Include="lvgl_mydemo\screen\gui_test1_scr.c">
|
<ClCompile Include="lvgl_mydemo\screen\gui_test1_scr.c">
|
||||||
<Filter>lvgl_mydemo\srceen</Filter>
|
<Filter>lvgl_mydemo\srceen</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="lvgl_mydemo\log\gui_log.c">
|
||||||
|
<Filter>lvgl_mydemo\log</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="lvgl_mydemo\log\drv_log.c">
|
||||||
|
<Filter>lvgl_mydemo\log</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="LVGL.Simulator.rc" />
|
<ResourceCompile Include="LVGL.Simulator.rc" />
|
||||||
@@ -80,5 +86,8 @@
|
|||||||
<Filter Include="lvgl_mydemo\assert\image">
|
<Filter Include="lvgl_mydemo\assert\image">
|
||||||
<UniqueIdentifier>{5aec906d-b671-4778-9999-6dcadc840600}</UniqueIdentifier>
|
<UniqueIdentifier>{5aec906d-b671-4778-9999-6dcadc840600}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="lvgl_mydemo\log">
|
||||||
|
<UniqueIdentifier>{7c5bcdd0-7a51-46f7-804e-ed1f4371645d}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -96,6 +96,16 @@ BreakBeforeBinaryOperators: NonAssignment
|
|||||||
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
|
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
|
||||||
# 注:这里认为语句块也属于函数
|
# 注:这里认为语句块也属于函数
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterEnum: false
|
||||||
|
AfterStruct: false
|
||||||
|
AfterUnion: false
|
||||||
|
AfterCaseLabel: false
|
||||||
|
AfterClass: true
|
||||||
|
AfterFunction: true
|
||||||
|
SplitEmptyFunction: false
|
||||||
|
AfterNamespace: false
|
||||||
|
AfterExternBlock: false
|
||||||
|
|
||||||
# 在三元运算符前换行
|
# 在三元运算符前换行
|
||||||
BreakBeforeTernaryOperators: false
|
BreakBeforeTernaryOperators: false
|
||||||
@@ -133,7 +143,8 @@ FixNamespaceComments: true
|
|||||||
# 缩进case标签
|
# 缩进case标签
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
|
|
||||||
IndentPPDirectives: None
|
# Possible values: None\AfterHash\BeforeHash
|
||||||
|
IndentPPDirectives: AfterHash
|
||||||
|
|
||||||
# 缩进宽度
|
# 缩进宽度
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
@@ -219,7 +230,7 @@ IndentCaseLabels: true
|
|||||||
#三元运算符将放置在换行符之后
|
#三元运算符将放置在换行符之后
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
|
|
||||||
BreakBeforeBraces: Attach
|
BreakBeforeBraces: Custom
|
||||||
|
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
|
||||||
@@ -230,6 +241,9 @@ AlignTrailingComments: true
|
|||||||
AlignOperands: AlignAfterOperator
|
AlignOperands: AlignAfterOperator
|
||||||
|
|
||||||
#对齐宏
|
#对齐宏
|
||||||
|
# They can also be read as a whole for compatibility.
|
||||||
|
# The choices are:
|
||||||
|
# - None - Consecutive - AcrossEmptyLines - AcrossComments - AcrossEmptyLinesAndComments
|
||||||
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
|
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
|
||||||
#对齐连续等号
|
#对齐连续等号
|
||||||
AlignConsecutiveAssignments: AcrossEmptyLines
|
AlignConsecutiveAssignments: AcrossEmptyLines
|
||||||
|
|||||||
29
LVGL.Simulator/lvgl_mydemo/assert/inc_format
Normal file
29
LVGL.Simulator/lvgl_mydemo/assert/inc_format
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef INC_FORMAT_H
|
||||||
|
#define INC_FORMAT_H
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* DEFINES
|
||||||
|
* *******************************************************************************/
|
||||||
|
#ifdef __INC_FORMAT_C__
|
||||||
|
# define DEF_EXTERN
|
||||||
|
#else
|
||||||
|
# define DEF_EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* MACROS
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* TYPEDEFS
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* GLOBAL PROTOTYPES
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
#endif /* INC_FORMAT_H */
|
||||||
24
LVGL.Simulator/lvgl_mydemo/assert/src_format
Normal file
24
LVGL.Simulator/lvgl_mydemo/assert/src_format
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* DEFINES
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* MACROS
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* TYPEDEFS
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* STATIC FUNCTION
|
||||||
|
* *******************************************************************************/
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* GLOBAL FUNCTION
|
||||||
|
* *******************************************************************************/
|
||||||
@@ -29,14 +29,37 @@
|
|||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
* STATIC FUNCTION
|
* STATIC FUNCTION
|
||||||
* *******************************************************************************/
|
* *******************************************************************************/
|
||||||
|
static void log_write_timer_cb(lv_timer_t *t)
|
||||||
|
{
|
||||||
|
LV_UNUSED(t);
|
||||||
|
|
||||||
|
TRACE_V("Hello wrold!");
|
||||||
|
TRACE_D("Hello wrold!");
|
||||||
|
TRACE_I("Hello wrold!");
|
||||||
|
TRACE_E("Hello wrold!");
|
||||||
|
TRACE_W("Hello wrold!");
|
||||||
|
|
||||||
|
Lib_TraceProc();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool log_write_to_file(LIB_TRACE_ITEM_HANDLE_T *item)
|
||||||
|
{
|
||||||
|
TRACE_D("item info = %s", item->Buf);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
* GLOBAL FUNCTION
|
* GLOBAL FUNCTION
|
||||||
* *******************************************************************************/
|
* *******************************************************************************/
|
||||||
|
|
||||||
void lvgl_app_init(void) {
|
void lvgl_app_init(void)
|
||||||
|
{
|
||||||
|
Lib_TraceInit();
|
||||||
|
Lib_TraceRegistWriter(log_write_to_file);
|
||||||
|
|
||||||
DataModelInit();
|
DataModelInit();
|
||||||
|
|
||||||
ScrMgrInit();
|
ScrMgrInit();
|
||||||
ScrMgrSwitchScr(GUI_MIAN_SCR_ID, true);
|
ScrMgrSwitchScr(GUI_MIAN_SCR_ID, true);
|
||||||
|
|
||||||
|
lv_timer_create(log_write_timer_cb, 3000, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,20 +2,11 @@
|
|||||||
* FilePath : lvgl_app.h
|
* FilePath : lvgl_app.h
|
||||||
* Author : GX.Duan
|
* Author : GX.Duan
|
||||||
* Date : 2022-08-07 15:20:41
|
* Date : 2022-08-07 15:20:41
|
||||||
* LastEditTime : 2022-09-10 15:58:18
|
* LastEditTime : 2022-09-21 22:03:59
|
||||||
* LastEditors : ShallowGreen123 2608653986@qq.com
|
* LastEditors : ShallowGreen123 2608653986@qq.com
|
||||||
* Copyright (c): 2022 by GX.Duan, All Rights Reserved.
|
* Copyright (c): 2022 by GX.Duan, All Rights Reserved.
|
||||||
* Github : https://github.com/ShallowGreen123/lvgl_mydemo
|
* Github : https://github.com/ShallowGreen123/lvgl_mydemo
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
/************************************************************************
|
|
||||||
* FilePath : lvgl_app.h
|
|
||||||
* Author : GX.Duan
|
|
||||||
* Date : 2022-08-07
|
|
||||||
* LastEditTime : 2022-08-19
|
|
||||||
* LastEditors : ShallowGreen123 2608653986@qq.com
|
|
||||||
* Copyright (c): by GX.Duan, All Rights Reserved.
|
|
||||||
* Github : https://github.com/ShallowGreen123/lvgl_mydemo
|
|
||||||
************************************************************************/
|
|
||||||
#ifndef LV_DEMO_INIT_H
|
#ifndef LV_DEMO_INIT_H
|
||||||
#define LV_DEMO_INIT_H
|
#define LV_DEMO_INIT_H
|
||||||
|
|
||||||
@@ -24,6 +15,7 @@
|
|||||||
* *******************************************************************************/
|
* *******************************************************************************/
|
||||||
#include "../lvgl/lvgl.h"
|
#include "../lvgl/lvgl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "log/gui_log.h"
|
||||||
#include "data/dataModel.h"
|
#include "data/dataModel.h"
|
||||||
#include "screen/gui_scr_mgr.h"
|
#include "screen/gui_scr_mgr.h"
|
||||||
|
|
||||||
@@ -34,9 +26,9 @@ extern "C" {
|
|||||||
* DEFINES
|
* DEFINES
|
||||||
* *******************************************************************************/
|
* *******************************************************************************/
|
||||||
#ifdef __LVGL_APP_C__
|
#ifdef __LVGL_APP_C__
|
||||||
#define DEF_EXTERN
|
# define DEF_EXTERN
|
||||||
#else
|
#else
|
||||||
#define DEF_EXTERN extern
|
# define DEF_EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
/************************************************************************
|
||||||
|
* FilePath : gui_main_scr.c
|
||||||
|
* Author : GX.Duan
|
||||||
|
* Date : 2022-08-19 00:25:00
|
||||||
|
* LastEditTime : 2022-09-21 22:11:15
|
||||||
|
* LastEditors : ShallowGreen123 2608653986@qq.com
|
||||||
|
* Copyright (c): 2022 by GX.Duan, All Rights Reserved.
|
||||||
|
* Github : https://github.com/ShallowGreen123/lvgl_mydemo
|
||||||
|
************************************************************************/
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* FilePath : gui_main_scr.c
|
* FilePath : gui_main_scr.c
|
||||||
* Author : GX.Duan
|
* Author : GX.Duan
|
||||||
@@ -38,7 +47,7 @@ void swithc_btn_event_cb(lv_event_t *e) {
|
|||||||
lv_obj_t *obj = lv_event_get_target(e);
|
lv_obj_t *obj = lv_event_get_target(e);
|
||||||
|
|
||||||
if (obj == switch_btn) {
|
if (obj == switch_btn) {
|
||||||
printf("Screen 1 switch_btn is pressed!\n");
|
TRACE_I("Screen 1 switch_btn is pressed!");
|
||||||
ScrMgrPushScr(GUI_TEST1_SCR_ID, true);
|
ScrMgrPushScr(GUI_TEST1_SCR_ID, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
/************************************************************************
|
||||||
|
* FilePath : gui_test1_scr.c
|
||||||
|
* Author : GX.Duan
|
||||||
|
* Date : 2022-09-10 17:10:59
|
||||||
|
* LastEditTime : 2022-09-21 22:46:10
|
||||||
|
* LastEditors : ShallowGreen123 2608653986@qq.com
|
||||||
|
* Copyright (c): 2022 by GX.Duan, All Rights Reserved.
|
||||||
|
* Github : https://github.com/ShallowGreen123/lvgl_mydemo
|
||||||
|
************************************************************************/
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* FilePath : gui_test1_scr.c
|
* FilePath : gui_test1_scr.c
|
||||||
* Author : GX.Duan
|
* Author : GX.Duan
|
||||||
@@ -39,7 +48,7 @@ void test1_btn_event_cb(lv_event_t *e) {
|
|||||||
lv_obj_t *obj = lv_event_get_target(e);
|
lv_obj_t *obj = lv_event_get_target(e);
|
||||||
|
|
||||||
if (obj == test1_btn) {
|
if (obj == test1_btn) {
|
||||||
printf("Screen 2 test1_btn is pressed!\n");
|
TRACE_I("Screen 2 test1_btn is pressed!");
|
||||||
ScrMgrPopScr(true);
|
ScrMgrPopScr(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user