1load("//bazel:defs.bzl", "compatible_with_rp2")
2
3package(default_visibility = ["//visibility:public"])
4
5# This exists to break a dependency cycle between
6# this library and //src/common/hardware_claim.
7# Application code should always use :hardware_sync instead.
8cc_library(
9    name = "hardware_sync_headers",
10    hdrs = ["include/hardware/sync.h"],
11    includes = ["include"],
12    target_compatible_with = compatible_with_rp2(),
13    visibility = [
14        "//src/common/hardware_claim:__pkg__",
15        "//src/common/pico_sync:__pkg__",
16        "//src/rp2_common/hardware_sync_spin_lock:__pkg__",
17    ],
18    deps = [
19        "//src/rp2_common/hardware_base",
20    ],
21)
22
23cc_library(
24    name = "hardware_sync",
25    srcs = ["sync.c"],
26    target_compatible_with = compatible_with_rp2(),
27    deps = [
28        ":hardware_sync_headers",
29        "//src/common/hardware_claim",
30        "//src/common/pico_base_headers",
31        "//src/common/pico_sync:pico_sync_headers",
32        "//src/rp2_common:hardware_regs",
33        "//src/rp2_common:hardware_structs",
34        "//src/rp2_common/hardware_base",
35        "//src/rp2_common/hardware_sync_spin_lock",
36        "//src/rp2_common/hardware_sync_spin_lock:hardware_sync_spin_lock_headers",
37    ],
38)
39