# Copyright 2024 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.
load("@pigweed//pw_build:merge_flags.bzl", "flags_from_dict")
load("@pigweed//targets/rp2040:transition.bzl", "RP2_SYSTEM_FLAGS")

package(default_visibility = ["//visibility:public"])

# This is an incomplete platform, do NOT try to pass this
# as a --platforms flag value. Use :rp2040 or :rp2350.
platform(
    name = "rp2_common",
    constraint_values = [
        "@freertos//:disable_task_statics",
        "@pigweed//pw_build/constraints/rtos:freertos",
        "@pigweed//pw_build/constraints/chipset:rp2040",  # TODO: https://pwbug.dev/343487589 - Use Pico SDK constraints.
        "@pigweed//pw_cpu_exception:enabled",
        "@pigweed//pw_interrupt_cortex_m:backend",
        "@platforms//os:none",
    ],
    flags = flags_from_dict(RP2_SYSTEM_FLAGS | {
        "//system:system": "//targets/rp2:system",
        "@freertos//:freertos_config": "//targets/rp2:freertos_config",
        "@pico-sdk//bazel/config:PICO_CLIB": "llvm_libc",
        "@pico-sdk//bazel/config:PICO_TOOLCHAIN": "clang",
        "@pigweed//pw_build:default_module_config": "//system:module_config",
        "@pigweed//pw_system:extra_platform_libs": "//targets/rp2:extra_platform_libs",
        "@pigweed//pw_system:io_backend": "@pigweed//pw_system:sys_io_target_io",
        "@pigweed//pw_toolchain:cortex-m_toolchain_kind": "clang",
        "@pigweed//pw_unit_test:config_override": "//targets/rp2:64k_unit_tests",
        "@pigweed//pw_unit_test:main": "//targets/rp2:unit_test_rpc_main",
    }),
)

platform(
    name = "rp2040",
    constraint_values = [
        "@freertos//:port_ARM_CM0",
        "@pico-sdk//bazel/constraint:rp2040",
        # For toolchain selection.
        "@platforms//cpu:armv6-m",
        "@pw_toolchain//constraints/arm_mcpu:cortex-m0",
    ],
    parents = [":rp2_common"],
)

platform(
    name = "rp2350",
    constraint_values = [
        "@freertos//:port_ARM_CM33_NTZ",
        "@pico-sdk//bazel/constraint:rp2350",
        # For toolchain selection.
        "@platforms//cpu:armv8-m",
        "@pw_toolchain//constraints/arm_mcpu:cortex-m33",
    ],
    parents = [":rp2_common"],
)

cc_library(
    name = "extra_platform_libs",
    deps = [
        "@pico-sdk//src/rp2_common/pico_stdlib:pico_stdlib",
        "@pigweed//pw_tokenizer:linker_script",
    ] + select({
        "@rules_cc//cc/compiler:clang": [
            "@pigweed//pw_libcxx",
        ],
        "//conditions:default": [],
    }),
    alwayslink = 1,
)

cc_library(
    name = "freertos_config",
    hdrs = [
        "config/FreeRTOSConfig.h",
    ],
    includes = ["config"],
    deps = ["@pigweed//third_party/freertos:config_assert"],
)

cc_library(
    name = "thread_config_overrides",
    defines = [
        "PW_THREAD_FREERTOS_CONFIG_JOINING_ENABLED=1",
    ],
)

cc_library(
    name = "system",
    srcs = [
        "led.cc",
        "system.cc",
    ],
    implementation_deps = [
        "//system:headers",
        "@pico-sdk//src/rp2_common/cmsis:cmsis_core",
        "@pico-sdk//src/rp2_common/hardware_adc",
        "@pico-sdk//src/rp2_common/hardware_exception:hardware_exception",
        "@pico-sdk//src/rp2_common/pico_stdlib:pico_stdlib",
        "@pigweed//pw_channel",
        "@pigweed//pw_channel:rp2_stdio_channel",
        "@pigweed//pw_cpu_exception:entry_backend_impl",
        "@pigweed//pw_digital_io_rp2040",
        "@pigweed//pw_multibuf:simple_allocator",
        "@pigweed//pw_system:async",
        "@pigweed//third_party/freertos:support",
    ],
    deps = ["//system:headers"],
    alwayslink = 1,
)

cc_library(
    name = "unit_test_rpc_main",
    testonly = True,
    srcs = ["unit_test_rpc_main.cc"],
    deps = [
        "//system",
        "@pigweed//pw_log",
        "@pigweed//pw_system:async",
        "@pigweed//pw_unit_test:rpc_service",

        # These should be provided by pw_system:async.
        "@pigweed//pw_assert:assert_backend_impl",
        "@pigweed//pw_assert:check_backend_impl",
        "@pigweed//pw_log:backend_impl",
        "@pigweed//pw_system:extra_platform_libs",
    ],
)

# Several tests store `TestWorker` thread contexts in their unit test object.
# Since these thread stacks are currently 32k, the test objects may be large.
cc_library(
    name = "64k_unit_tests",
    defines = [
        "PW_UNIT_TEST_CONFIG_MEMORY_POOL_SIZE=65536",
    ],
)
