From 9ec7acc1269e079f59d4e11157ecb54ed18c6b3d Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Mon, 2 Nov 2020 15:51:36 +0900 Subject: [PATCH] fota_gui_common : get rotate_angle from build option of cmake Change-Id: I879e8931b002fbbf7419583e4c9187feb36e50fb --- fota_gui_common/CMakeLists.txt | 1 + fota_gui_common/fota_gr_direct_ro_common.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/fota_gui_common/CMakeLists.txt b/fota_gui_common/CMakeLists.txt index 7587c0b..f4af0a0 100644 --- a/fota_gui_common/CMakeLists.txt +++ b/fota_gui_common/CMakeLists.txt @@ -59,6 +59,7 @@ ADD_EXECUTABLE(${FOTA_GUI_COMMON} ${GUI_SRCS_COMMON}) TARGET_LINK_LIBRARIES(${FOTA_GUI_COMMON} ${gui_pkgs_LDFLAGS} ${LIBS} -lpthread) ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") +ADD_DEFINITIONS("-DROTATE=270") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/common/images DESTINATION ${RESDIR_COMMON}) INSTALL(TARGETS ${FOTA_GUI_COMMON} DESTINATION ${BINDIR}) diff --git a/fota_gui_common/fota_gr_direct_ro_common.c b/fota_gui_common/fota_gr_direct_ro_common.c index b96a5df..b9c5729 100644 --- a/fota_gui_common/fota_gr_direct_ro_common.c +++ b/fota_gui_common/fota_gr_direct_ro_common.c @@ -37,6 +37,10 @@ #define MAX_PATH 256 #define MAX_FILE_PATH 512 +#if !defined(ROTATE) +#define ROTATE 0 +#endif + #if !defined(RESDIR) #define RESDIR "/usr/share/res" #endif @@ -617,6 +621,13 @@ void fota_gr_direct_clear_screen(u32 color) _gr_direct_update_screen(); } +void _get_rotate(void) +{ + rotate_angle = ROTATE; + LOG("Print Rotate Angle value = %d\n", rotate_angle); + rollback_rotate_angle = 360 - rotate_angle; +} + /*----------------------------------------------------------------------------- fota_gr_direct_init ----------------------------------------------------------------------------*/ @@ -626,6 +637,7 @@ int fota_gr_direct_init(void) if (fb_open(&s_fbi) < 0) LOG("fb_open failed \n"); + _get_rotate(); __init_screen(&s_fbi); tdm_if_lcd_on(&s_disp); -- 2.34.1