make fix
This commit is contained in:
parent
3b20eb03b9
commit
4516717d4e
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
build
|
||||
.cache/
|
||||
compile_commands.json
|
@ -1,8 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
project(lvgl)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
|
||||
|
||||
@ -10,13 +13,18 @@ file(GLOB_RECURSE INCLUDES "./*.h" )
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "-O3")
|
||||
|
||||
set(LV_CONF_PATH
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/PSE-firmware/Drivers/lv_conf.h
|
||||
CACHE STRING "" FORCE)
|
||||
|
||||
cmake_print_variables(LV_CONF_PATH)
|
||||
|
||||
find_package(SDL2 REQUIRED SDL2)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
|
||||
add_subdirectory(PSE-firmware/Drivers/lvgl)
|
||||
include_directories(PSE-firmware/Core/Inc)
|
||||
include_directories(PSE-firmware/Drivers)
|
||||
add_executable(main main.c PSE-firmware/Core/Src/logo_mint_resize.c PSE-firmware/Core/Src/home_screen.c ${SOURCES} ${INCLUDES})
|
||||
add_executable(main main.c PSE-firmware/Core/Src/logo_mint_resize.c PSE-firmware/Core/Src/home_screen.c PSE-firmware/Core/Src/PSE_unit.c PSE-firmware/Core/Src/PSE_unit_edit_screen.c ${SOURCES} ${INCLUDES})
|
||||
add_compile_definitions(LV_CONF_INCLUDE_SIMPLE)
|
||||
target_link_libraries(main PRIVATE lvgl ${SDL2_LIBRARIES})
|
||||
add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 285890cb9cc69dd8cdad002f57cd28bea3d84963
|
||||
Subproject commit db11ea6c460397abf20f2d41b2176b559765048f
|
12
main.c
12
main.c
@ -1,12 +1,15 @@
|
||||
#include "main.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_pixels.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "PSE_unit.h"
|
||||
#include "home_screen.h"
|
||||
#include "PSE_unit.h"
|
||||
|
||||
#define BUFF_SIZE (320 * 10)
|
||||
#define LCD_WIDTH 320
|
||||
@ -20,7 +23,6 @@ SDL_Window* window = NULL;
|
||||
|
||||
SDL_Surface* screenSurface = NULL;
|
||||
|
||||
|
||||
int main(int argc, char** argv){
|
||||
if(SDL_Init( SDL_INIT_VIDEO ) < 0){
|
||||
printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
|
||||
@ -68,7 +70,9 @@ int main(int argc, char** argv){
|
||||
lv_label_set_text(cursor, "A");
|
||||
lv_indev_set_cursor(my_indev, cursor);
|
||||
|
||||
Home_Screen_Gen();
|
||||
pse_unit pse_units[PSE_UNITS_NUM];
|
||||
load_units((pse_unit*)&pse_units, PSE_UNITS_NUM);
|
||||
Home_Screen_Gen((pse_unit*)&pse_units, PSE_UNITS_NUM);
|
||||
|
||||
pthread_t tickThread;
|
||||
pthread_create(&tickThread, NULL, tick_thread, NULL);
|
||||
|
4
main.h
4
main.h
@ -1,3 +1,7 @@
|
||||
#include "lvgl.h"
|
||||
|
||||
#define PSE_UNITS_NUM 4 // number of units (4 in our case, X, Y, Z and extr)
|
||||
|
||||
void my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * buf);
|
||||
void touchscreen_read_callback(lv_indev_drv_t * drv, lv_indev_data_t*data);
|
||||
void * tick_thread (void *args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user