Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compiler definition to get board RAM size #55

Open
wants to merge 1 commit into
base: release-1.1-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Arduino/System/BoardToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function (SetupBoardToolchain boards_namespace board_id generate_dir)
string(TOUPPER "${pl_arch}" ARDUINO_BOARD_BUILD_ARCH)
_board_get_platform_property("/pl_path" ARDUINO_BOARD_RUNTIME_PLATFORM_PATH)

# Get board RAM size
_board_get_property("upload.maximum_data_size" board_ram_size)

# Inherit the platform.txt from the referenced platform. This gets
# overriden later, if the platform provides its own platform.txt.
_board_get_property("build.core" _prop_value QUIET)
Expand Down Expand Up @@ -530,6 +533,7 @@ function (SetupBoardToolchain boards_namespace board_id generate_dir)
set(ARDUINO_BOARD_IDENTIFIER "${_short_id}")
set(ARDUINO_BOARD_NAME "${board_name}")
set(ARDUINO_GENERATE_DIR "${generate_dir}")
set(ARDUINO_BOARD_RAM_SIZE "${board_ram_size}")

set(templates_dir "${ARDUINO_TOOLCHAIN_DIR}/Arduino/Templates")
configure_file(
Expand Down
1 change: 1 addition & 0 deletions Arduino/Templates/ArduinoSystem.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(ARDUINO_CORE_SPECIFIC_PLATFORM_PATH "@ARDUINO_CORE_SPECIFIC_PLATFORM_PATH@")
set(ARDUINO_BOARD_BUILD_CORE_PATH "@ARDUINO_BOARD_BUILD_CORE_PATH@")
set(ARDUINO_BOARD_BUILD_VARIANT_PATH "@ARDUINO_BOARD_BUILD_VARIANT_PATH@")
set(ARDUINO_BOARD_HOST_NAME "@ARDUINO_BOARD_HOST_NAME@")
set(ARDUINO_BOARD_RAM_SIZE "@ARDUINO_BOARD_RAM_SIZE@")

@ARDUINO_SEL_MENU_SET_LIST@

Expand Down