Ubiquitous/Framework/:update the lvgl lib,and it's verified on the xidatong arm base on rt-thread.notice cancel lwip module,because dtcm limited.
This commit is contained in:
parent
520e775a3b
commit
564f48d1eb
|
@ -0,0 +1,11 @@
|
|||
import os
|
||||
from building import *
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
cwd = GetCurrentDir()
|
||||
DEPENDS = ["LIB_LV"]
|
||||
SOURCES = []
|
||||
SOURCES = ['lv_init.c'] + ['lv_demo.c']+['lv_demo_calendar.c']
|
||||
path = [cwd]
|
||||
objs = DefineGroup('sensor_app', src = SOURCES, depend = DEPENDS,CPPPATH = path)
|
||||
Return("objs")
|
|
@ -39,7 +39,7 @@ static void event_handler(lv_event_t * e)
|
|||
void lv_demo_calendar(void)
|
||||
{
|
||||
lv_obj_t * calendar = lv_calendar_create(lv_scr_act());
|
||||
lv_obj_set_size(calendar, 800, 480);//lv_obj_set_size(calendar, 800, 480);
|
||||
lv_obj_set_size(calendar, MY_DISP_HOR_RES, MY_DISP_VER_RES);//lv_obj_set_size(calendar, 800, 480);
|
||||
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
#ifndef _STDBOOL_H
|
||||
typedef signed char bool;
|
||||
//typedef signed char bool;
|
||||
#endif
|
||||
typedef signed char int8;
|
||||
typedef signed short int16;
|
||||
|
@ -165,6 +165,56 @@ struct PrivIoctlCfg
|
|||
void *args;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 x_pos;
|
||||
uint16 y_pos;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
uint8 font_size;
|
||||
uint8 *addr;
|
||||
uint16 font_color;
|
||||
uint16 back_color;
|
||||
}LcdStringParam;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 x_startpos;
|
||||
uint16 x_endpos;
|
||||
uint16 y_startpos;
|
||||
uint16 y_endpos;
|
||||
void* pixel_color;
|
||||
}LcdPixelParam;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char type; // 0:write string;1:write dot
|
||||
LcdPixelParam pixel_info;
|
||||
LcdStringParam string_info;
|
||||
}LcdWriteParam;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t press;
|
||||
}TouchDataParam;
|
||||
|
||||
#define PRIV_SYSTICK_GET (rt_tick_get())
|
||||
#define PRIV_LCD_DEV "/dev/lcd"
|
||||
#define MY_DISP_HOR_RES LCD_WIDTH
|
||||
#define MY_DISP_VER_RES LCD_HEIGHT
|
||||
|
||||
#define PRIV_TOUCH_DEV "/dev/touch"
|
||||
#define MY_INDEV_X LCD_WIDTH
|
||||
#define MY_INDEV_Y LCD_HEIGHT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*********************shell***********************/
|
||||
//for int func(int argc, char *agrv[])
|
||||
#define PRIV_SHELL_CMD_MAIN_ATTR
|
||||
|
|
|
@ -8,7 +8,9 @@ cwd = GetCurrentDir()
|
|||
|
||||
src = []
|
||||
inc = []
|
||||
|
||||
src += ['../porting/lv_port_disp_template.c']
|
||||
src += ['../porting/lv_port_fs_template.c']
|
||||
src += ['../porting/lv_port_indev_template.c']
|
||||
lvgl_cwd = cwd + '/../'
|
||||
lvgl_src_cwd = lvgl_cwd + 'src/'
|
||||
|
||||
|
@ -19,6 +21,7 @@ for root, dirs, files in os.walk(lvgl_src_cwd):
|
|||
src = src + Glob(os.path.join(root,dir,'*.c'))
|
||||
inc = inc + [os.path.join(root,dir)]
|
||||
|
||||
inc = inc + [lvgl_cwd]
|
||||
LOCAL_CCFLAGS = ''
|
||||
if rtconfig.PLATFORM == 'gcc': # GCC
|
||||
LOCAL_CCFLAGS += ' -std=c99'
|
||||
|
@ -27,39 +30,15 @@ elif rtconfig.PLATFORM == 'armcc': # Keil AC5
|
|||
elif rtconfig.PLATFORM == 'armclang': # Keil AC6
|
||||
LOCAL_CCFLAGS += ' -std=c99 -g -w'
|
||||
|
||||
group = DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
||||
group = DefineGroup('LVGL', src, depend = ['LIB_LV'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
||||
|
||||
port_src = Glob('*.c')
|
||||
port_inc = [cwd]
|
||||
group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc)
|
||||
port_inc = [cwd]+['../porting/']
|
||||
group = group + DefineGroup('LVGL-port', port_src, depend = ['LIB_LV'], CPPPATH = port_inc)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
#
|
||||
# try:
|
||||
# shutil.rmtree(os.path.join(lvgl_cwd, '.github'))
|
||||
# shutil.rmtree(os.path.join(lvgl_cwd, 'docs'))
|
||||
# shutil.rmtree(os.path.join(lvgl_cwd, 'scripts'))
|
||||
# shutil.rmtree(os.path.join(lvgl_cwd, 'tests'))
|
||||
# shutil.rmtree(os.path.join(lvgl_cwd, 'zephyr'))
|
||||
# os.remove(os.path.join(lvgl_cwd, '.codecov.yml'))
|
||||
# os.remove(os.path.join(lvgl_cwd, '.editorconfig'))
|
||||
# os.remove(os.path.join(lvgl_cwd, '.gitignore'))
|
||||
# os.remove(os.path.join(lvgl_cwd, '.gitmodules'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'CMakeLists.txt'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'component.mk'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'idf_component.yml'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'Kconfig'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'library.json'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'library.properties'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'lv_conf_template.h'))
|
||||
# os.remove(os.path.join(lvgl_cwd, 'lvgl.mk'))
|
||||
# except:
|
||||
# pass
|
||||
#
|
||||
|
||||
Return('group')
|
||||
|
|
|
@ -16,69 +16,12 @@
|
|||
#define LV_RTTHREAD_INCLUDE <rtthread.h>
|
||||
#include LV_RTTHREAD_INCLUDE
|
||||
|
||||
/*=========================
|
||||
MEMORY SETTINGS
|
||||
*=========================*/
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
# define LV_MEM_CUSTOM 1
|
||||
# define LV_MEM_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE
|
||||
# define LV_MEM_CUSTOM_ALLOC rt_malloc
|
||||
# define LV_MEM_CUSTOM_FREE rt_free
|
||||
# define LV_MEM_CUSTOM_REALLOC rt_realloc
|
||||
#endif
|
||||
|
||||
/*====================
|
||||
HAL SETTINGS
|
||||
*====================*/
|
||||
|
||||
#define LV_TICK_CUSTOM 1
|
||||
#define LV_TICK_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE
|
||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (rt_tick_get_millisecond()) /*Expression evaluating to current system time in ms*/
|
||||
|
||||
/*=======================
|
||||
* FEATURE CONFIGURATION
|
||||
*=======================*/
|
||||
|
||||
/*-------------
|
||||
* Logging
|
||||
*-----------*/
|
||||
|
||||
#ifdef PKG_LVGL_ENABLE_LOG
|
||||
# define LV_USE_LOG 1
|
||||
# define LV_LOG_PRINTF 0
|
||||
#else
|
||||
# define LV_USE_LOG 0
|
||||
#endif
|
||||
|
||||
/*-------------
|
||||
* Asserts
|
||||
*-----------*/
|
||||
|
||||
#define LV_ASSERT_HANDLER_INCLUDE LV_RTTHREAD_INCLUDE
|
||||
#define LV_ASSERT_HANDLER RT_ASSERT(0);
|
||||
|
||||
/*-------------
|
||||
* Others
|
||||
*-----------*/
|
||||
|
||||
#define LV_SPRINTF_CUSTOM 1
|
||||
#define LV_SPRINTF_INCLUDE LV_RTTHREAD_INCLUDE
|
||||
#ifdef __ARMCC_VERSION
|
||||
#define lv_snprintf rt_snprintf
|
||||
#define lv_vsnprintf rt_vsnprintf
|
||||
#define LV_SPRINTF_USE_FLOAT 0
|
||||
|
||||
/*=====================
|
||||
* COMPILER SETTINGS
|
||||
*====================*/
|
||||
|
||||
#ifdef RT_USING_BIG_ENDIAN
|
||||
# define LV_BIG_ENDIAN_SYSTEM 1
|
||||
#else
|
||||
# define LV_BIG_ENDIAN_SYSTEM 0
|
||||
#endif
|
||||
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN ALIGN(4)
|
||||
|
||||
|
||||
/*--END OF LV_RT_THREAD_CONF_H--*/
|
||||
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-10-18 Meco Man The first version
|
||||
*/
|
||||
|
||||
#ifdef __RTTHREAD__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <lvgl.h>
|
||||
#define DBG_TAG "LVGL"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
||||
# include <lv_port_disp.h>
|
||||
#endif
|
||||
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
||||
# include <lv_port_indev.h>
|
||||
#endif
|
||||
|
||||
#if LV_USE_LOG && LV_LOG_PRINTF
|
||||
static void lv_rt_log(const char *buf)
|
||||
{
|
||||
LOG_I(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int lv_port_init(void)
|
||||
{
|
||||
#if LV_USE_LOG && LV_LOG_PRINTF
|
||||
lv_log_register_print_cb(lv_rt_log);
|
||||
#endif
|
||||
|
||||
lv_init();
|
||||
|
||||
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
||||
lv_port_disp_init();
|
||||
#endif
|
||||
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
||||
lv_port_indev_init();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_COMPONENT_EXPORT(lv_port_init);
|
||||
|
||||
#endif /*__RTTHREAD__*/
|
|
@ -547,6 +547,7 @@ static size_t _etoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen,
|
|||
#endif // PRINTF_SUPPORT_FLOAT
|
||||
|
||||
// internal vsnprintf
|
||||
#ifndef __ARMCC_VERSION
|
||||
static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, const char * format, va_list va)
|
||||
{
|
||||
unsigned int flags, width, precision, n;
|
||||
|
@ -859,9 +860,9 @@ static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, cons
|
|||
// return written chars without terminating \0
|
||||
return (int)idx;
|
||||
}
|
||||
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ARMCC_VERSION
|
||||
int lv_snprintf(char * buffer, size_t count, const char * format, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
@ -875,5 +876,5 @@ int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va)
|
|||
{
|
||||
return _vsnprintf(_out_buffer, buffer, count, format, va);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /*LV_SPRINTF_CUSTOM*/
|
||||
|
|
|
@ -78,8 +78,9 @@ typedef struct {
|
|||
* null character. A value equal or larger than count indicates truncation. Only when the returned value
|
||||
* is non-negative and less than count, the string has been completely written.
|
||||
*/
|
||||
int lv_snprintf(char * buffer, size_t count, const char * format, ...) LV_FORMAT_ATTRIBUTE(3, 4);
|
||||
int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) LV_FORMAT_ATTRIBUTE(3, 0);
|
||||
|
||||
//int lv_snprintf(char * buffer, size_t count, const char * format, ...) LV_FORMAT_ATTRIBUTE(3, 4);
|
||||
//int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) LV_FORMAT_ATTRIBUTE(3, 0);
|
||||
|
||||
#else
|
||||
#include LV_SPRINTF_INCLUDE
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file dev_touch.h
|
||||
* @brief define touch dev function using bus driver framework
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2021-04-24
|
||||
*/
|
||||
|
||||
#ifndef DEV_TOUCH_H
|
||||
#define DEV_TOUCH_H
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
struct TouchDataStandard
|
||||
{
|
||||
uint16 x;
|
||||
uint16 y;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Binary file not shown.
After Width: | Height: | Size: 602 KiB |
Loading…
Reference in New Issue