Skip to content

Commit

Permalink
Get version/dir from bootstrap, add pyelftools
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagepc committed Jul 27, 2022
1 parent d4a46a0 commit 9001d98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.15)
include(cmake/Utilities.cmake)

set (CMAKE_CXX_STANDARD 11)
set (PRUSA_BOARDS 1.0.5-2)

get_dependency_directory(prusa3dboards PRUSA_BOARDS_DIR)
project(Prusa-Firmware)

get_recommended_gcc_version(RECOMMENDED_TOOLCHAIN_VERSION)
Expand Down Expand Up @@ -76,7 +77,7 @@ endif()
#
file(GLOB FW_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Firmware/*.c*)
file(GLOB FW_HEADERS RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Firmware/*.h*)
file(GLOB AVR_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/*.c*)
file(GLOB AVR_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PRUSA_BOARDS_DIR}/cores/prusa_einsy_rambo/*.c*)

# Setup language resources:
file(GLOB LANG_VARIANTS RELATIVE ${PROJECT_SOURCE_DIR}/lang/po ${PROJECT_SOURCE_DIR}/lang/po/Firmware_??.po)
Expand All @@ -86,8 +87,8 @@ message("Languages found: ${LANG_VARIANTS}")

add_library(avr_core STATIC ${AVR_SOURCES})
target_include_directories(avr_core PRIVATE
${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/
${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/variants/prusa_einsy_rambo/
${PRUSA_BOARDS_DIR}/cores/prusa_einsy_rambo/
${PRUSA_BOARDS_DIR}/variants/prusa_einsy_rambo/
)
target_compile_options(avr_core PUBLIC -mmcu=atmega2560)

Expand All @@ -99,7 +100,7 @@ function(fw_add_variant variant_name)


# # configure linker script
set(LINKER_SCRIPT ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/ldscripts/avr6.xn)
set(LINKER_SCRIPT ${PRUSA_BOARDS_DIR}/ldscripts/avr6.xn)
target_link_options(${variant_name} PUBLIC -Wl,-T,${LINKER_SCRIPT})

# limit the text section to 248K (256K - 8k reserved for the bootloader)
Expand All @@ -126,8 +127,8 @@ function(fw_add_variant variant_name)


target_include_directories(${variant_name} PRIVATE Firmware
${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/
${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/variants/prusa_einsy_rambo/
${PRUSA_BOARDS_DIR}/cores/prusa_einsy_rambo/
${PRUSA_BOARDS_DIR}/variants/prusa_einsy_rambo/
${PROJECT_SOURCE_DIR}/cmake/helpers/ # Add our magic config helper :)
)

Expand Down
3 changes: 1 addition & 2 deletions cmake/LocalAvrGcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ include("${PROJECT_CMAKE_DIR}/Utilities.cmake")
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR avr)
set(CMAKE_CROSSCOMPILING 1)
set(AVR_GCC_VERSION 7.3.0)
set(AVR_TOOLCHAIN_DIR "${PROJECT_CMAKE_DIR}/../.dependencies/avr-gcc-${AVR_GCC_VERSION}/")
get_dependency_directory("avr-gcc" AVR_TOOLCHAIN_DIR)
message( "tc dir is ${AVR_TOOLCHAIN_DIR}")
#
# Utilities
Expand Down
2 changes: 1 addition & 1 deletion utils/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
},
}
pip_dependencies = []
pip_dependencies = ["pyelftools"]
# yapf: enable


Expand Down

0 comments on commit 9001d98

Please sign in to comment.