[fix] update examples cdk project

This commit is contained in:
jzlv 2021-06-04 17:51:00 +08:00
parent c2f3072455
commit 5cca7f0193
57 changed files with 473 additions and 547 deletions

View file

@ -1,9 +1,10 @@
set(BSP_COMMON_DIR ${CMAKE_SOURCE_DIR}/bsp/bsp_common)
set(TARGET_REQUIRED_LIBS fatfs lvgl)
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/lvgl_flash.ld)
set(TARGET_REQUIRED_PRIVATE_INCLUDE ${BSP_COMMON_DIR}/il9341 ${BSP_COMMON_DIR}/lvgl)
set(TARGET_REQUIRED_PRIVATE_INCLUDE ${BSP_COMMON_DIR}/il9341 ${BSP_COMMON_DIR}/lvgl ${BSP_COMMON_DIR}/touch ${BSP_COMMON_DIR}/spi_sd)
file(GLOB_RECURSE sources "${CMAKE_CURRENT_SOURCE_DIR}/demo/*.c")
set(TARGET_REQUIRED_SRCS ${sources} ${BSP_COMMON_DIR}/il9341/bsp_il9341.c ${BSP_COMMON_DIR}/lvgl/lv_port_disp.c)
set(TARGET_REQUIRED_SRCS ${sources} ${BSP_COMMON_DIR}/il9341/bsp_il9341.c ${BSP_COMMON_DIR}/lvgl/lv_port_disp.c ${BSP_COMMON_DIR}/lvgl/lv_port_indev.c ${BSP_COMMON_DIR}/lvgl/lv_port_fs.c
${BSP_COMMON_DIR}/touch/xpt2046.c ${BSP_COMMON_DIR}/touch/touch.c ${BSP_COMMON_DIR}/fatfs/fatfs_spi_sd.c ${BSP_COMMON_DIR}/spi_sd/bsp_spi_sd.c)
set(mains main.c)
generate_bin()

View file

@ -110,8 +110,8 @@ void lv_demo_printer(void)
bg_color_act = LV_DEMO_PRINTER_BLUE;
lv_theme_t * th = lv_demo_printer_theme_init(LV_COLOR_BLACK, LV_COLOR_BLACK,
0, &lv_font_montserrat_8, &lv_font_montserrat_8,
&lv_font_montserrat_8, &lv_font_montserrat_8);
0, &lv_font_montserrat_12, &lv_font_montserrat_12,
&lv_font_montserrat_12, &lv_font_montserrat_12);
lv_theme_set_act(th);
lv_obj_t * scr = lv_obj_create(NULL, NULL);

View file

@ -19,32 +19,41 @@
* License for the specific language governing permissions and limitations
* under the License.
*
* Note:
*
* This Case is currently based on BL706_AVB development board with ili9341 controller screen.
* If you use other hardware platforms, please modify the pin Settings by yourself
*
* Your should Short connect func1 and func2 jump cap on 706_AVB Board,and Plug the screen into the HD13 interface
* Then the hardware for lvgl case testing is available.
*
*
*/
/***************************************************************************
* bl706_avb 使
* ili9341
*
* 使 bl706_avb
* 1. func1 func2
* 2. SPI HD13
*
* *************************************************************************/
// #include "drv_shell.h"
#include "hal_spi.h"
#include "hal_gpio.h"
#include "hal_dma.h"
#include "lv_port_disp.h"
#include "bsp_il9341.h"
#include "xpt2046.h"
#include "lv_port_disp.h"
#include "lv_port_indev.h"
#include "lvgl.h"
#include "lv_examples.h"
/* lvgl log cb */
void lv_log_print_g_cb(lv_log_level_t level, const char *path, uint32_t line, const char *name, const char *str)
{
MSG("L:%d,",level);
MSG("N:%s,",name);
MSG("D:%s\r\n,",str);
switch (level)
{
case LV_LOG_LEVEL_ERROR: MSG("ERROR: "); break;
case LV_LOG_LEVEL_WARN: MSG("WARNING: "); break;
case LV_LOG_LEVEL_INFO: MSG("INFO: "); break;
case LV_LOG_LEVEL_TRACE: MSG("TRACE: "); break;
default: break;
}
MSG("%s- ",name);
MSG(" %s\r\n,",str);
}
int main(void)
@ -52,9 +61,10 @@ int main(void)
bflb_platform_init(0);
lv_log_register_print_cb(lv_log_print_g_cb);
lv_init();
lv_port_disp_init();
lv_port_indev_init();
lv_demo_benchmark();