| # Copyright 2022 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| import("//build_overrides/pi_pico.gni") |
| import("//build_overrides/pigweed.gni") |
| |
| import("$dir_pw_build/target_types.gni") |
| import("$dir_pw_docgen/docs.gni") |
| import("$dir_pw_toolchain/arm_gcc/toolchains.gni") |
| import("$dir_pw_toolchain/generate_toolchain.gni") |
| import("board_configs.gni") |
| |
| if (current_toolchain != default_toolchain) { |
| config("config_includes") { |
| include_dirs = [ "config" ] |
| } |
| |
| pw_source_set("freertos_config") { |
| public_configs = [ ":config_includes" ] |
| public_deps = [ "$dir_pw_third_party/freertos:config_assert" ] |
| public = [ "config/FreeRTOSConfig.h" ] |
| } |
| |
| pw_source_set("pre_init") { |
| configs = [ ":pw_malloc_active" ] |
| public_deps = [ "$dir_pw_boot" ] |
| deps = [ |
| "$dir_pw_malloc", |
| "$dir_pw_preprocessor", |
| "$dir_pw_string", |
| "$dir_pw_third_party/freertos", |
| ] |
| sources = [ "boot.cc" ] |
| } |
| } |
| |
| generate_toolchain("rp2040") { |
| _excluded_members = [ |
| "defaults", |
| "name", |
| ] |
| _toolchain_base = pw_toolchain_arm_gcc.cortex_m0plus_size_optimized |
| forward_variables_from(_toolchain_base, "*", _excluded_members) |
| |
| # For now, no Pigweed configurations set up. |
| defaults = { |
| forward_variables_from(_toolchain_base.defaults, "*") |
| |
| # Merge in the app_common_BACKEND and various application settings |
| # which are defined in board_configs.gni. |
| # forward_variables_from(board_config_st7735, "*") |
| # forward_variables_from(board_config_st7789, "*") |
| forward_variables_from(board_config_ili9341, "*") |
| |
| pw_build_EXECUTABLE_TARGET_TYPE = "pico_executable" |
| pw_build_EXECUTABLE_TARGET_TYPE_FILE = |
| get_path_info("$dir_pigweed/targets/rp2040/pico_executable.gni", |
| "abspath") |
| pw_unit_test_MAIN = "$dir_pigweed/targets/rp2040:pico_logging_test_main" |
| pw_assert_BACKEND = dir_pw_assert_basic |
| pw_log_BACKEND = dir_pw_log_basic |
| pw_sys_io_BACKEND = dir_pw_sys_io_pico |
| |
| pw_sync_INTERRUPT_SPIN_LOCK_BACKEND = |
| "$dir_pw_sync_baremetal:interrupt_spin_lock" |
| pw_sync_MUTEX_BACKEND = "$dir_pw_sync_baremetal:mutex" |
| |
| pw_third_party_freertos_CONFIG = "//targets/rp2040:freertos_config" |
| pw_third_party_freertos_PORT = |
| "//third_party/freertos:arm_cm0_freertos_port" |
| |
| # Silence GN variable overwrite warning. |
| pw_build_LINK_DEPS = [] |
| |
| pw_build_LINK_DEPS = [ |
| "$dir_pw_assert:impl", |
| "$dir_pw_log:impl", |
| ] |
| |
| # Configure backend for pw_board_led |
| pw_board_led_BACKEND = "$dir_pw_board_led_pico" |
| |
| # Configure backend for pw_spin_delay |
| pw_spin_delay_BACKEND = "$dir_pw_spin_delay_pico" |
| |
| # Configure backend for pw_touchscreen |
| pw_touchscreen_BACKEND = "$dir_pw_touchscreen_null" |
| |
| current_cpu = "arm" |
| current_os = "" |
| } |
| } |