Skip to content

Commit

Permalink
feat(examples): update bsp of esp_brookesia_phone_p4_function_ev_board
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzw655 committed Oct 23, 2024
1 parent 9508dd4 commit e349760
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
22 changes: 8 additions & 14 deletions .gitlab/tools/build_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@
PROJECT_ROOT = Path(__file__).parent.parent.parent.absolute()
APPS_BUILD_PER_JOB = 30
IGNORE_WARNINGS = [
r'memory region \`iram_loader_seg\' not declared',
r'redeclaration of memory region \`iram_loader_seg\'',
r'1/2 app partitions are too small',
r'The current IDF version does not support using the gptimer API',
r'DeprecationWarning: pkg_resources is deprecated as an API',
r'\'ADC_ATTEN_DB_11\' is deprecated',
r'warning: unknown kconfig symbol*',
r'warning High Performance Mode \(QSPI Flash > 80MHz\) is optional feature that depends on flash model. Read Docs First!',
r'warning HPM-DC, which helps to run some flash > 80MHz by adjusting dummy cycles, is no longer enabled by default.',
r'warning To enable this feature, your bootloader needs to have the support for it \(by explicitly selecting BOOTLOADER_FLASH_DC_AWARE\)',
r'warning If your bootloader does not support it, select SPI_FLASH_HPM_DC_DISABLE to suppress the warning. READ DOCS FIRST!',
r'cc1plus: warning: command-line option \'-Wno-incompatible-pointer-types\' is valid for C/ObjC but not for C\+\+',
r'DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html',
r'The smallest app partition is nearly full',
r'managed_components/lvgl__lvgl/src/extra/libs/png/lv_png.c',
r'managed_components/lvgl__lvgl/src/extra/libs/png/lv_png.c',
]

def _get_idf_version():
Expand Down Expand Up @@ -63,10 +58,9 @@ def get_cmake_apps(
build_log_filename='build_log.txt',
size_json_filename='size.json',
check_warnings=True,
preserve=True,
default_build_targets=default_build_targets,
manifest_files=[
str(Path(PROJECT_ROOT) /'.build-rules.yml'),
str(Path(PROJECT_ROOT)/'.build-rules.yml'),
],
)
return apps
Expand All @@ -75,7 +69,6 @@ def get_cmake_apps(
def main(args): # type: (argparse.Namespace) -> None
default_build_targets = args.default_build_targets.split(',') if args.default_build_targets else None
apps = get_cmake_apps(args.paths, args.target, args.config, default_build_targets)

if args.find:
if args.output:
os.makedirs(os.path.dirname(os.path.realpath(args.output)), exist_ok=True)
Expand Down Expand Up @@ -108,6 +101,7 @@ def main(args): # type: (argparse.Namespace) -> None
keep_going=True,
ignore_warning_strs=IGNORE_WARNINGS,
copy_sdkconfig=True,
no_preserve=False,
)

sys.exit(ret_code)
Expand All @@ -126,7 +120,7 @@ def main(args): # type: (argparse.Namespace) -> None
)
parser.add_argument(
'--config',
default=['sdkconfig.defaults=defaults', 'sdkconfig.ci.*=', '=defaults'],
default=['sdkconfig.ci=default', 'sdkconfig.ci.*=', '=default'],
action='append',
help='Adds configurations (sdkconfig file names) to build. This can either be '
'FILENAME[=NAME] or FILEPATTERN. FILENAME is the name of the sdkconfig file, '
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* feat(phone): cancel navigation bar and enable gesture-based navigation by default
* feat(phone): add stylesheet 320x480, 800x1280, 1280x800
* feat(squareline): add ui_comp
* feat(examples): update bsp of esp_brookesia_phone_p4_function_ev_board

### Bugfixes:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
dependencies:
## Required IDF version
idf: ">=5.3"
espressif/esp32_p4_function_ev_board: "^3"
espressif/esp32_p4_function_ev_board: "^4"
espressif/esp-brookesia:
version: "*"
override_path: "../../../../../esp-brookesia"
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ extern "C" void app_main(void)
bsp_display_cfg_t cfg = {
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
.buffer_size = BSP_LCD_H_RES * BSP_LCD_V_RES,
.double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE,
.flags = {
.buff_dma = false,
.buff_spiram = true,
.sw_rotate = false,
}
};
lv_disp_t *disp = bsp_display_start_with_config(&cfg);
Expand All @@ -46,11 +49,15 @@ extern "C" void app_main(void)
ESP_BROOKESIA_CHECK_NULL_EXIT(phone, "Create phone failed");

/* Try using a stylesheet that corresponds to the resolution */
ESP_Brookesia_PhoneStylesheet_t *phone_stylesheet = nullptr;
if ((BSP_LCD_H_RES == 1024) && (BSP_LCD_V_RES == 600)) {
ESP_LOGI(TAG, "Using external stylesheet");
ESP_Brookesia_PhoneStylesheet_t *phone_stylesheet = new ESP_Brookesia_PhoneStylesheet_t ESP_BROOKESIA_PHONE_1024_600_DARK_STYLESHEET();
phone_stylesheet = new ESP_Brookesia_PhoneStylesheet_t ESP_BROOKESIA_PHONE_1024_600_DARK_STYLESHEET();
ESP_BROOKESIA_CHECK_NULL_EXIT(phone_stylesheet, "Create phone stylesheet failed");

} else if ((BSP_LCD_H_RES == 800) && (BSP_LCD_V_RES == 1280)) {
phone_stylesheet = new ESP_Brookesia_PhoneStylesheet_t ESP_BROOKESIA_PHONE_800_1280_DARK_STYLESHEET();
ESP_BROOKESIA_CHECK_NULL_EXIT(phone_stylesheet, "Create phone stylesheet failed");
}
if (phone_stylesheet != nullptr) {
ESP_LOGI(TAG, "Using stylesheet (%s)", phone_stylesheet->core.name);
ESP_BROOKESIA_CHECK_FALSE_EXIT(phone->addStylesheet(phone_stylesheet), "Add phone stylesheet failed");
ESP_BROOKESIA_CHECK_FALSE_EXIT(phone->activateStylesheet(phone_stylesheet), "Activate phone stylesheet failed");
Expand Down

0 comments on commit e349760

Please sign in to comment.