프로그램 사용/gcc2026. 2. 18. 22:22

gcc 로 빌드하면 현재 빌드하는 시스템이 c가 아닌 cpp 라는걸 확인하기 위해(혹은 알려주기 위해)

__cplusplus 라는 선언을 -D__cplusplus 하듯 붙여주는 듯 한데

__cplusplus__가 아니라 왜 앞에만 언더바 두 개 일까.. -_-?

 

__STDC__
In normal operation, this macro expands to the constant 1, to signify that this compiler conforms to ISO Standard C. If GNU CPP is used with a compiler other than GCC, this is not necessarily true; however, the preprocessor always conforms to the standard unless the -traditional-cpp option is used.

This macro is not defined if the -traditional-cpp option is used.

On some hosts, the system compiler uses a different convention, where __STDC__ is normally 0, but is 1 if the user specifies strict conformance to the C Standard. CPP follows the host convention when processing system header files, but when processing user files __STDC__ is always 1. This has been reported to cause problems; for instance, some versions of Solaris provide X Windows headers that expect __STDC__ to be either undefined or 1. See Invocation.

__STDC_VERSION__
This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year and month of the Standard version. This signifies which version of the C Standard the compiler conforms to. Like __STDC__, this is not necessarily accurate for the entire implementation, unless GNU CPP is being used with GCC.

The value 199409L signifies the 1989 C standard as amended in 1994, which is the current default; the value 199901L signifies the 1999 revision of the C standard; the value 201112L signifies the 2011 revision of the C standard; the value 201710L signifies the 2017 revision of the C standard (which is otherwise identical to the 2011 version apart from correction of defects). The value 202311L is used for the -std=c23 and -std=gnu23 modes. An unspecified value larger than 202311L is used for the experimental -std=c2y and -std=gnu2y modes.

This macro is not defined if the -traditional-cpp option is used, nor when compiling C++ or Objective-C.

__STDC_HOSTED__
This macro is defined, with value 1, if the compiler’s target is a hosted environment. A hosted environment has the complete facilities of the standard C library available.

__cplusplus
This macro is defined when the C++ compiler is in use. You can use __cplusplus to test whether a header is compiled by a C compiler or a C++ compiler. This macro is similar to __STDC_VERSION__, in that it expands to a version number. Depending on the language standard selected, the value of the macro is 199711L for the 1998 C++ standard, 201103L for the 2011 C++ standard, 201402L for the 2014 C++ standard, 201703L for the 2017 C++ standard, 202002L for the 2020 C++ standard, 202302L for the 2023 C++ standard, or an unspecified value strictly larger than 202302L for the experimental languages enabled by -std=c++26 and -std=gnu++26.

__OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in use. You can use __OBJC__ to test whether a header is compiled by a C compiler or an Objective-C compiler.

__ASSEMBLER__
This macro is defined with value 1 when preprocessing assembly language.

[링크 : https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html]

 

 Version    __cplusplus
  4.8.3       201300L
  4.9.2       201300L
  5.1.0       201402L

[링크 : https://stackoverflow.com/questions/30995705/cplusplus-201402l-return-true-in-gcc-even-when-i-specified-std-c14[

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc __attribute__((weak)) 테스트  (0) 2026.01.29
gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc tree vectorize  (0) 2023.01.26
gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
Posted by 구차니
프로그램 사용/lvgl2026. 2. 18. 18:32

기본적으로 30fps 를 출력하는 것 같아서 속도를 더 올릴 수 없나 찾아보는중

 

sdkconfig
#
# HAL Settings
#
CONFIG_LV_DEF_REFR_PERIOD=33
CONFIG_LV_DPI_DEF=130
# end of HAL Settings

 

lv_conf_internal.h
/*====================
   HAL SETTINGS
 *====================*/

/** Default display refresh, input device read and animation step period. */
#ifndef LV_DEF_REFR_PERIOD
    #ifdef CONFIG_LV_DEF_REFR_PERIOD
        #define LV_DEF_REFR_PERIOD CONFIG_LV_DEF_REFR_PERIOD
    #else
        #define LV_DEF_REFR_PERIOD  33      /**< [ms] */
    #endif
#endif

 

lv_demo_benchmark.h
/**
 * Run all benchmark scenes.
 *
 * On the summary end screen the values shall be interpreted according to the following:
 * - CPU usage:
 *    - If `LV_SYSMON_GET_IDLE` is not modified it's measured based on the time spent in
 *      `lv_timer_handler`.
 *    - If an (RT)OS is used `LV_SYSMON_GET_IDLE` can be changed to a custom function
 *      which returns the idle percentage of idle task.
 *
 * - FPS: LVGL attempted to render this many times in a second. It's limited based on `LV_DEF_REFR_PERIOD`
 *
 * - Render time: LVGL spent this much time with rendering only. It's not aware of task yielding,
 *   but simply the time difference between the start and end of the rendering is measured
 *
 * - Flush time: It's the sum of
 *     - the time spent in the `flush_cb` and
 *     - the time spent with waiting for flush ready.
 */
void lv_demo_benchmark(void);
lv_display.c
lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
{
    /*Create a refresh timer*/
    disp->refr_timer = lv_timer_create(lv_display_refr_timer, LV_DEF_REFR_PERIOD, disp);
    LV_ASSERT_MALLOC(disp->refr_timer);
    if(disp->refr_timer == NULL) {
        lv_free(disp);
        return NULL;
    }
}

 

다만 perf test 쪽 헤더를 쓰게 되면 16msec로 60fps로 상향되는 듯.

lv_test_perf_conf.h

/**
 * @file lv_conf.h
 * Configuration file for v9.3.0-dev
 */

/*
 * Copy this file as `lv_conf.h`
 * 1. simply next to `lvgl` folder
 * 2. or to any other place and
 *    - define `LV_CONF_INCLUDE_SIMPLE`;
 *    - add the path as an include path.
 */

/* clang-format off */
#if 1 /* Set this to "1" to enable content */

    #ifndef LV_CONF_H
        #define LV_CONF_H

        #define LV_BUILD_TEST_PERF 1
        #define LV_USE_TEST 1
        /* If you need to include anything here, do it inside the `__ASSEMBLY__` guard */
        #if  0 && defined(__ASSEMBLY__)
            #include "my_include.h"
        #endif

        /*====================
        HAL SETTINGS
        *====================*/

        /** Default display refresh, input device read and animation step period. */
        #define LV_DEF_REFR_PERIOD  16      /**< [ms] */

        /** Default Dots Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
        * (Not so important, you can adjust it to modify default sizes and spaces.) */
        #define LV_DPI_DEF 130              /**< [px/inch] */

'프로그램 사용 > lvgl' 카테고리의 다른 글

esp32 lvgl 관련 링크들  (0) 2026.02.18
lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니
프로그램 사용/lvgl2026. 2. 18. 10:59

idf를 통해서 처음부터 올리고 싶은데 잘 안보이네..

 

[링크 : https://blog.naver.com/alfee0/223742807419] 알피공

[링크 : https://fishpoint.tistory.com/12311] 캐어랩

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl 속도 제한(?) 해제  (0) 2026.02.18
lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니
프로그램 사용/lvgl2026. 2. 13. 11:16

lv_conf.h 에서 아래를 14 에서 28로 바꾸고 빌드하니 잘된다.

/*Always set a default font*/
//#define LV_FONT_DEFAULT &lv_font_montserrat_14
#define LV_FONT_DEFAULT &lv_font_montserrat_28

 

lv_font.h 에서 아래처럼 되어있는데 


/**
 * Just a wrapper around LV_FONT_DEFAULT because it might be more convenient to use a function in some cases
 * @return  pointer to LV_FONT_DEFAULT
 */
static inline const lv_font_t * lv_font_default(void)
{
    return LV_FONT_DEFAULT;
}

 

lv_style.c 에서도 결국에는 LV_FONT_DEFAULT 에서 정의된걸 끌어가는것 같은데.. 잘 모르겠네

lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)
{
    lv_style_value_t value;
    switch(prop) {
        case LV_STYLE_TRANSFORM_ZOOM:
            value.num = LV_IMG_ZOOM_NONE;
            break;
        case LV_STYLE_BG_COLOR:
            value.color = lv_color_white();
            break;
        case LV_STYLE_BG_GRAD_COLOR:
        case LV_STYLE_BORDER_COLOR:
        case LV_STYLE_SHADOW_COLOR:
        case LV_STYLE_OUTLINE_COLOR:
        case LV_STYLE_ARC_COLOR:
        case LV_STYLE_LINE_COLOR:
        case LV_STYLE_TEXT_COLOR:
        case LV_STYLE_IMG_RECOLOR:
            value.color = lv_color_black();
            break;
        case LV_STYLE_OPA:
        case LV_STYLE_BORDER_OPA:
        case LV_STYLE_TEXT_OPA:
        case LV_STYLE_IMG_OPA:
        case LV_STYLE_BG_IMG_OPA:
        case LV_STYLE_OUTLINE_OPA:
        case LV_STYLE_SHADOW_OPA:
        case LV_STYLE_LINE_OPA:
        case LV_STYLE_ARC_OPA:
            value.num = LV_OPA_COVER;
            break;
        case LV_STYLE_BG_GRAD_STOP:
            value.num = 255;
            break;
        case LV_STYLE_BORDER_SIDE:
            value.num = LV_BORDER_SIDE_FULL;
            break;
        case LV_STYLE_TEXT_FONT:
            value.ptr = LV_FONT_DEFAULT;
            break;
        case LV_STYLE_MAX_WIDTH:
        case LV_STYLE_MAX_HEIGHT:
            value.num = LV_COORD_MAX;
            break;
        default:
            value.ptr = NULL;
            value.num = 0;
            break;
    }

    return value;
}

 

아무튼 콤보박스에서 터치해서 목록을 띄우면 14로 뜨는데 이렇게 기본을 키우니 오히려 속 편하기도 하다.

그런데 코드보다보니

lv_theme.c 에서 아래처럼 폰트 패밀리를 small normal large로 쓸수 있을것 같은데 찾아봐야겠다.

const lv_font_t * lv_theme_get_font_small(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_small : LV_FONT_DEFAULT;
}

const lv_font_t * lv_theme_get_font_normal(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_normal : LV_FONT_DEFAULT;
}

const lv_font_t * lv_theme_get_font_large(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_large : LV_FONT_DEFAULT;
}

 

[링크 : https://docs.lvgl.io/9.2/overview/font.html]

[링크 : https://forum.lvgl.io/t/how-to-change-font-size/20531]

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl 속도 제한(?) 해제  (0) 2026.02.18
esp32 lvgl 관련 링크들  (0) 2026.02.18
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니
프로그램 사용/lvgl2026. 2. 11. 17:18

textarea 니까 전체 교체가 아니라 내용 추가도 있고

최대 텍스트 길이도 주어질 수 있다. (라인수로 되진 않음)

[링크 : https://docs.lvgl.io/master/widgets/textarea.html]

 

void lv_textarea_set_max_length(lv_obj_t *obj, uint32_t num)
Set max length of a Text Area.
Parameters:
  • obj – pointer to a text area object
  • num – the maximal number of characters can be added (lv_textarea_set_text ignores it)

[링크 : https://docs.lvgl.io/master/API/widgets/textarea/lv_textarea_h.html#_CPPv426lv_textarea_set_max_lengthP8lv_obj_t8uint32_t]

 

 void lv_textarea_add_text(lv_obj_t *obj, const char *txt)
Insert a text to the current cursor position
Parameters:
  • obj – pointer to a text area object
  • txt – a '\0' terminated string to insert

[링크 : https://docs.lvgl.io/master/API/widgets/textarea/lv_textarea_h.html#_CPPv420lv_textarea_add_textP8lv_obj_tPKc]

'프로그램 사용 > lvgl' 카테고리의 다른 글

esp32 lvgl 관련 링크들  (0) 2026.02.18
lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
lvgl simulator  (0) 2026.02.10
Posted by 구차니
프로그램 사용/lvgl2026. 2. 10. 23:13

export 메뉴에는 크게 두 가지가 존재한다.

 

create template project로 하면 상위 디렉토리가 좀 많이 생기고

그 안에  esp-idf용 sdkconfig 파일까지 생성된다(다르게 말하면 프로젝트 생성시 개발할 타겟 보드를 잘 설정해야 한다는 의미)

 

export ui files 하면

create template project에서 생성된 ui 디렉토리 하위의 내용과 동일한 것 같다(diff까진 안해봐서..)

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
lvgl textarea  (0) 2026.02.11
squareline studio 보드설정  (0) 2026.02.10
lvgl simulator  (0) 2026.02.10
squareline studio / 애니메이션  (0) 2026.02.03
Posted by 구차니
프로그램 사용/lvgl2026. 2. 10. 23:08

아무생각 없이 export 했다가 sdkconfig보고 기겁을 해서(esp32-s3를 난 설정한적이 없는데!)

부랴부랴 설정이 변경한지 메뉴를 뒤져보니 proejct settings 발견

 

창은 창인데 f4로 안닫히고, esc로도 안닫히는 나쁜 창!

아무튼 board properfies에 esp-s3 이런식으로 되어있었나 보다.

 

esp32-wroom-32 쓰는 중인데 아마 얘가 esp wrover 칩일꺼라 이거면 될거 같은데

version 1.0.0을 택하면 LVGLdl 8.3.11만 가능해지고

 

version 2.0.0을 택하면 LVGLdl 9.1.0만 가능해진다.

 

7점대는 완전 구조가 다르다고는 하는데.. 8.3.11이 아니면 약간 낮은 버전에서는 쓰기 힘들려나?

그럼 9.x랑 8.x도 구조가 많이 다른가?

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
lvgl simulator  (0) 2026.02.10
squareline studio / 애니메이션  (0) 2026.02.03
squareline studio / 화면전환  (0) 2026.02.03
Posted by 구차니
프로그램 사용/lvgl2026. 2. 10. 11:08

ubuntu + sdl + lvgl pc port

[링크 : https://memories.tistory.com/155]

[링크 : https://github.com/lvgl/lv_port_pc_vscode]

 

윈도우 + lvgl pc port fork -> visual studio port

[링크 : https://blog.naver.com/chandong83/223025089463]

[링크 : https://github.com/lvgl/lv_port_pc_visual_studio]

'프로그램 사용 > lvgl' 카테고리의 다른 글

squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
squareline studio / 애니메이션  (0) 2026.02.03
squareline studio / 화면전환  (0) 2026.02.03
nxp gui guider for lvgl  (0) 2026.02.03
Posted by 구차니
프로그램 사용/lvgl2026. 2. 3. 23:50

 

요건 도움말을 보던가 문서를 봐야 알 듯.

아무튼 이미지를 추가하고 어떻게 하는것 같은데 감이 올 듯 안 올 듯.. 한다

 

 

[링크 : https://docs.squareline.io/docs/dev_env/animation/]

'프로그램 사용 > lvgl' 카테고리의 다른 글

squareline studio 보드설정  (0) 2026.02.10
lvgl simulator  (0) 2026.02.10
squareline studio / 화면전환  (0) 2026.02.03
nxp gui guider for lvgl  (0) 2026.02.03
lvgl perf mon  (0) 2026.02.03
Posted by 구차니
프로그램 사용/lvgl2026. 2. 3. 23:24

보이는 하나의 디자인을 screen 으로 부르고

스크린간 전환은 

trigger - clicked

action - change screen 으로 하여 구현이 된다.

그래서 메인화면에서 톱니바퀴를 누르면 설정으로 fade on 하여 가게 되는데

 

새로운 이벤트 목록은 아래와 같다.

일단 위의 경우 사용된건 change screen 인데

그 외에는 set opacity나 play animation 정도가 눈에 띈다.

 

fade on 대신 move left / move right 하고

duration 100 msec에서 1000 msec 으로 해주면 좀 슬라이드 되는 느낌이 들게 움직인다.

아래는 move left 전환효과를 순간 캡쳐 한 것.

 

 

---

스크린 변경이 아니라 일부 그룹에 대한 show / hide로 구현된 경우도 있는데

우측 하단의 3개를 누르면 속도는 뜨면서 내용이 변한다.

 

 

아무튼 설정을 보면

action - play 에서 group driving을 딜레이 없이 animation on 을 한다는데,

initial action 에 on으로 정의 된 건 없어서 모르겠다. on/off 의 on 같기도 한데?

 

그리고 BTN BG1 ADD / BTN BG2/3 REMOVE로

선택되었다는 밝은 주황색 배경을 on/off 해준다.

 

 

 

 

 

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl simulator  (0) 2026.02.10
squareline studio / 애니메이션  (0) 2026.02.03
nxp gui guider for lvgl  (0) 2026.02.03
lvgl perf mon  (0) 2026.02.03
ebike demo ui 구조 분석 - 속도 슬라이더 및 텍스트  (0) 2026.02.02
Posted by 구차니