中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

金堂做網(wǎng)站的公司快手流量推廣網(wǎng)站

金堂做網(wǎng)站的公司,快手流量推廣網(wǎng)站,自己做網(wǎng)站步驟 域名,國(guó)內(nèi)創(chuàng)意網(wǎng)站案例移植前準(zhǔn)備 移植好fbtft屏幕驅(qū)動(dòng) 參考鏈接:友善之臂NanoPi NEO利用fbtft驅(qū)動(dòng)點(diǎn)亮1.69寸ST7789V2屏幕 獲取源碼 名稱(chēng)地址描述lvglhttps://github.com/lvgl/lvgl.gitlvgl-8.3.5lv_drivershttps://github.com/lvgl/lv_drivers.gitlv_drivers-6.1.1 創(chuàng)建工程目錄 創(chuàng)…

移植前準(zhǔn)備

移植好fbtft屏幕驅(qū)動(dòng)
參考鏈接:友善之臂NanoPi NEO利用fbtft驅(qū)動(dòng)點(diǎn)亮1.69寸ST7789V2屏幕

獲取源碼

名稱(chēng)地址描述
lvglhttps://github.com/lvgl/lvgl.gitlvgl-8.3.5
lv_drivershttps://github.com/lvgl/lv_drivers.gitlv_drivers-6.1.1

創(chuàng)建工程目錄

創(chuàng)建工程目錄

mkdir lvgl_display

下載的源碼解壓到該文件夾,將文件夾名稱(chēng)中的版本號(hào)去掉

mv lvgl-8.3.5 lvgl
mv lv_drivers-6.1.1 lv_drivers

將頭文件復(fù)制到工程目錄下,去掉名稱(chēng)中的template

lvgl_display/lvgl/lv_conf_template.h => lvgl_display/lv_conf.h
lvgl_display/lv_drivers/lv_drv_conf_template.h => lvgl_display/lv_drv_conf.h

工程目錄下創(chuàng)建main.c,Makefile,創(chuàng)建文件夾build工程目錄文件如下:

名稱(chēng)描述
main.c測(cè)試程序
Makefile編譯腳本
lv_conf.hlvgl配置文件
lv_drv_conf.hlvgl驅(qū)動(dòng)配置文件
lvgllvgl8.3.5源碼
lv_driverslvgl驅(qū)動(dòng)源碼
build編譯過(guò)程文件

ls
rwxrwxr-x  2 pi pi   16384 813 11:22 build/
-rw-rw-r--  1 pi pi   26339 813 11:16 lv_conf.h
drwxrwxr-x  6 pi pi    4096 14  2020 lv_drivers/
-rw-rw-r--  1 pi pi   11196 813 09:19 lv_drv_conf.h
drwxrwxr-x 10 pi pi    4096 27  2023 lvgl/
-rw-rw-r--  1 pi pi    2401 813 11:22 main.c
-rw-rw-r--  1 pi pi    1956 813 11:05 Makefile

修改配置文件lv_drv_conf.h

將#if 0修改為#if 1

/*** @file lv_drv_conf.h**//** COPY THIS FILE AS lv_drv_conf.h*/#if 1 /*Set it to "1" to enable the content*/#ifndef LV_DRV_CONF_H
#define LV_DRV_CONF_H#include "lv_conf.h"

將宏USE_FBDEV的值改為1,使能frame buffer設(shè)備

/*-----------------------------------------*  Linux frame buffer device (/dev/fbx)*-----------------------------------------*/
#ifndef USE_FBDEV
#  define USE_FBDEV           1
#endif#if USE_FBDEV
#  define FBDEV_PATH          "/dev/fb0"
#endif

修改lv_conf.h

將文件最開(kāi)始的#if 0改為#if 1

/* clang-format off */
#if 1 /*Set it to "1" to enable content*/#ifndef LV_CONF_H
#define LV_CONF_H#include <stdint.h>

使能宏LV_MEM_CUSTOM為1

/*=========================MEMORY SETTINGS*=========================*//*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#define LV_MEM_CUSTOM 1
#if LV_MEM_CUSTOM == 0/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/#define LV_MEM_SIZE (48U * 1024U)          /*[bytes]*//*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/#define LV_MEM_ADR 0     /*0: unused*//*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/#if LV_MEM_ADR == 0#undef LV_MEM_POOL_INCLUDE#undef LV_MEM_POOL_ALLOC#endif#else       /*LV_MEM_CUSTOM*/#define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/#define LV_MEM_CUSTOM_ALLOC   malloc#define LV_MEM_CUSTOM_FREE    free#define LV_MEM_CUSTOM_REALLOC realloc
#endif     /*LV_MEM_CUSTOM*/

最后是比較關(guān)鍵的一個(gè)設(shè)置,TICK的配置,我們選擇自己定義一個(gè)Tick定時(shí)器配置函數(shù),在自己的應(yīng)用程序中實(shí)現(xiàn),源碼用#if 0屏蔽

#if 0	//原始代碼
/*Use a custom tick source that tells the elapsed time in milliseconds.*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#define LV_TICK_CUSTOM 0
#if LV_TICK_CUSTOM#define LV_TICK_CUSTOM_INCLUDE "Arduino.h"         /*Header for the system time function*/#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())    /*Expression evaluating to current system time in ms*//*If using lvgl as ESP32 component*/// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif   /*LV_TICK_CUSTOM*/#else	//新代碼
/*Use a custom tick source that tells the elapsed time in milliseconds.*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#define LV_TICK_CUSTOM 1
#if LV_TICK_CUSTOM#define LV_TICK_CUSTOM_INCLUDE <stdint.h>         /*Header for the system time function*/#define LV_TICK_CUSTOM_SYS_TIME_EXPR (custom_tick_get())    /*Expression evaluating to current system time in ms*/
#endif   /*LV_TICK_CUSTOM*/
#endif

使能music例程

#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1/*Music player demo*/
#define LV_USE_DEMO_MUSIC 1

修改lv_drivers/display/fbdev.c

不修改可能導(dǎo)致系統(tǒng)崩潰

screensize = finfo.line_length * vinfo.yres;  

main.c內(nèi)容

#include "lvgl/lvgl.h"
//#include "lvgl/demos/lv_demos.h" //未使用 屏蔽
#include "lv_drivers/display/fbdev.h"
#include "lv_drivers/indev/evdev.h"
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>#define DISP_BUF_SIZE (128 * 1024)int main(void)
{/*LittlevGL init*/lv_init();/*Linux frame buffer device init*/fbdev_init();/*A small buffer for LittlevGL to draw the screen's content*/static lv_color_t buf[DISP_BUF_SIZE];/*Initialize a descriptor for the buffer*/static lv_disp_draw_buf_t disp_buf;lv_disp_draw_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);/*Initialize and register a display driver*/static lv_disp_drv_t disp_drv;lv_disp_drv_init(&disp_drv);disp_drv.draw_buf   = &disp_buf;disp_drv.flush_cb   = fbdev_flush;//修改分辨率disp_drv.hor_res    = 280;disp_drv.ver_res    = 240;lv_disp_drv_register(&disp_drv);
#if 0   //未使用輸入設(shè)備evdev_init();static lv_indev_drv_t indev_drv_1;lv_indev_drv_init(&indev_drv_1); /*Basic initialization*/indev_drv_1.type = LV_INDEV_TYPE_POINTER;/*This function will be called periodically (by the library) to get the mouse position and state*/indev_drv_1.read_cb = evdev_read;lv_indev_t *mouse_indev = lv_indev_drv_register(&indev_drv_1);/*Set a cursor for the mouse*/LV_IMG_DECLARE(mouse_cursor_icon)lv_obj_t * cursor_obj = lv_img_create(lv_scr_act()); /*Create an image object for the cursor */lv_img_set_src(cursor_obj, &mouse_cursor_icon);           /*Set the image source*/lv_indev_set_cursor(mouse_indev, cursor_obj);             /*Connect the image  object to the driver*/
#endif/*Create a Demo*/lv_demo_music();/*Handle LitlevGL tasks (tickless mode)*/while(1) {lv_timer_handler();usleep(5000);}return 0;
}/*Set in lv_conf.h as `LV_TICK_CUSTOM_SYS_TIME_EXPR`*/
uint32_t custom_tick_get(void)
{static uint64_t start_ms = 0;if(start_ms == 0) {struct timeval tv_start;gettimeofday(&tv_start, NULL);start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000;}struct timeval tv_now;gettimeofday(&tv_now, NULL);uint64_t now_ms;now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000;uint32_t time_ms = now_ms - start_ms;return time_ms;
}

Makefile

#
# Makefile
#
CC ?= gcc
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= ${shell pwd}
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare -std=c99
LDFLAGS ?= -lm
BIN = demo#Collect the files to compile
MAINSRC = ./main.cinclude $(LVGL_DIR)/lvgl/lvgl.mk
include $(LVGL_DIR)/lv_drivers/lv_drivers.mk
OBJ_DIR := $(LVGL_DIR)/build
#CSRCS +=$(LVGL_DIR)/my_ui/main.c 
##################################### 收集需要編譯的源文件 #####################################
CSRCS += $(LVGL_DIR)/main.c
##################################### 將文件名替換為.o文件 #####################################CXX_OBJCTS = $(patsubst  %.c, $(OBJ_DIR)/%.o, $(notdir $(CSRCS)))SOURSE_DIR = $(dir $(CSRCS))vpath %.c $(SOURSE_DIR)$(OBJ_DIR)/%.o: %.c$(CC) $(CFLAGS) -c $< -o $@echo "CC $<"all: $(CXX_OBJCTS)$(CC) -o $(BIN)  $(CXX_OBJCTS) $(LDFLAGS)
clean: rm -f $(BIN) $(CXX_OBJCTS)

效果展示

移植成功后

http://m.risenshineclean.com/news/65096.html

相關(guān)文章:

  • 商標(biāo)查詢(xún)網(wǎng)入口鄭州seo
  • 寧波城鄉(xiāng)建設(shè)局管方網(wǎng)站濟(jì)南seo網(wǎng)絡(luò)優(yōu)化公司
  • h5網(wǎng)站后臺(tái)管理模板培訓(xùn)課程開(kāi)發(fā)
  • 豪華網(wǎng)站建設(shè)外貿(mào)網(wǎng)絡(luò)營(yíng)銷(xiāo)推廣
  • 網(wǎng)站建設(shè)全視頻教程下載南寧seo計(jì)費(fèi)管理
  • 泰安定制網(wǎng)站建設(shè)公司項(xiàng)目推廣計(jì)劃書(shū)
  • 廣州網(wǎng)站建設(shè)培訓(xùn)學(xué)校網(wǎng)站alexa排名查詢(xún)
  • 深圳有哪些做網(wǎng)站的公司好企業(yè)如何做好網(wǎng)絡(luò)營(yíng)銷(xiāo)
  • 會(huì)員卡系統(tǒng)多少錢(qián)一套谷歌seo公司
  • 網(wǎng)站建設(shè)漢獅怎么樣seo研究協(xié)會(huì)網(wǎng)
  • 如何創(chuàng)建網(wǎng)站教程視頻微信朋友圈推廣
  • 重慶市建設(shè)工程信息網(wǎng)聯(lián)系電話(huà)自動(dòng)seo系統(tǒng)
  • 開(kāi)了網(wǎng)站建設(shè)公司 如何接業(yè)務(wù)競(jìng)價(jià)托管公司
  • 哪些網(wǎng)站是用python做的seo如何快速排名百度首頁(yè)
  • 如何在百度上做公司做網(wǎng)站百度上首頁(yè)
  • 通過(guò)做政府門(mén)戶(hù)網(wǎng)站的實(shí)驗(yàn)獲得什么發(fā)軟文是什么意思
  • 編制網(wǎng)站建設(shè)策劃書(shū)淘寶排名查詢(xún)工具
  • 長(zhǎng)沙有哪些網(wǎng)站建設(shè)公司經(jīng)典廣告語(yǔ)
  • 做網(wǎng)站地圖的步驟網(wǎng)絡(luò)推廣優(yōu)化seo
  • 動(dòng)態(tài)網(wǎng)站沒(méi)有數(shù)據(jù)庫(kù)怎么做巨量數(shù)據(jù)官網(wǎng)
  • 小程序開(kāi)發(fā) 網(wǎng)站建設(shè)網(wǎng)站做優(yōu)化好還是推廣好
  • 北京海淀區(qū)建設(shè)局網(wǎng)站萬(wàn)網(wǎng)
  • 做網(wǎng)站定制只要做好關(guān)鍵詞優(yōu)化
  • 用戶(hù)體驗(yàn)設(shè)計(jì)案例鄭州seo技術(shù)服務(wù)顧問(wèn)
  • 團(tuán)隊(duì)網(wǎng)站怎么做網(wǎng)絡(luò)營(yíng)銷(xiāo)首先要
  • 世紀(jì)佳緣網(wǎng)站開(kāi)發(fā)語(yǔ)言關(guān)鍵字是什么意思
  • 網(wǎng)站建設(shè)可行性研究鏈接提交
  • 一個(gè)旅游網(wǎng)站怎么做電商網(wǎng)站有哪些
  • 三水網(wǎng)站制作媒體資源網(wǎng)官網(wǎng)
  • nas服務(wù)器 做網(wǎng)站佛山優(yōu)化推廣