Skip to content

Commit 6892bbb

Browse files
committed
Add compiler definition ARDUINO_BOARD_RAM_SIZE
1 parent 953b2e6 commit 6892bbb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Arduino/System/BoardToolchain.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ function (SetupBoardToolchain boards_namespace board_id generate_dir)
5252
string(TOUPPER "${pl_arch}" ARDUINO_BOARD_BUILD_ARCH)
5353
_board_get_platform_property("/pl_path" ARDUINO_BOARD_RUNTIME_PLATFORM_PATH)
5454

55+
# Get board RAM size
56+
_board_get_property("upload.maximum_data_size" board_ram_size)
57+
5558
# Inherit the platform.txt from the referenced platform. This gets
5659
# overriden later, if the platform provides its own platform.txt.
5760
_board_get_property("build.core" _prop_value QUIET)
@@ -530,6 +533,7 @@ function (SetupBoardToolchain boards_namespace board_id generate_dir)
530533
set(ARDUINO_BOARD_IDENTIFIER "${_short_id}")
531534
set(ARDUINO_BOARD_NAME "${board_name}")
532535
set(ARDUINO_GENERATE_DIR "${generate_dir}")
536+
set(ARDUINO_BOARD_RAM_SIZE "${board_ram_size}")
533537

534538
set(templates_dir "${ARDUINO_TOOLCHAIN_DIR}/Arduino/Templates")
535539
configure_file(

Arduino/Templates/ArduinoSystem.cmake.in

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set(ARDUINO_CORE_SPECIFIC_PLATFORM_PATH "@ARDUINO_CORE_SPECIFIC_PLATFORM_PATH@")
2121
set(ARDUINO_BOARD_BUILD_CORE_PATH "@ARDUINO_BOARD_BUILD_CORE_PATH@")
2222
set(ARDUINO_BOARD_BUILD_VARIANT_PATH "@ARDUINO_BOARD_BUILD_VARIANT_PATH@")
2323
set(ARDUINO_BOARD_HOST_NAME "@ARDUINO_BOARD_HOST_NAME@")
24+
set(ARDUINO_BOARD_RAM_SIZE "@ARDUINO_BOARD_RAM_SIZE@")
2425

2526
@ARDUINO_SEL_MENU_SET_LIST@
2627

0 commit comments

Comments
 (0)