forked from raspberrypi/pico-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad43f3b
commit fb7fa3d
Showing
19 changed files
with
921 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
def _pico_generate_pio_header_impl(ctx): | ||
generated_headers = [] | ||
for f in ctx.files.srcs: | ||
out = ctx.actions.declare_file( | ||
"{}_pio_generated/{}.h".format(ctx.label.name, f.basename) | ||
) | ||
generated_headers.append(out) | ||
ctx.actions.run( | ||
executable = ctx.executable._pioasm_tool, | ||
arguments = [ | ||
"-o", | ||
"c-sdk", | ||
f.path, | ||
out.path, | ||
], | ||
inputs = [f], | ||
outputs = [out], | ||
) | ||
|
||
cc_ctx = cc_common.create_compilation_context( | ||
headers = depset(direct = generated_headers), | ||
includes = depset(direct = [generated_headers[0].dirname]), | ||
) | ||
return [ | ||
DefaultInfo(files=depset(direct = generated_headers)), | ||
CcInfo(compilation_context = cc_ctx), | ||
] | ||
|
||
pico_generate_pio_header = rule( | ||
implementation = _pico_generate_pio_header_impl, | ||
attrs = { | ||
"srcs": attr.label_list(mandatory = True, allow_files = True), | ||
"_pioasm_tool": attr.label( | ||
default = "@pico-sdk//tools/pioasm:pioasm", | ||
cfg = "exec", | ||
executable = True | ||
), | ||
}, | ||
provides = [CcInfo], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,84 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Prefer these aliases to directly referencing @btstack, as it's possible that | ||
# name may change. | ||
alias( | ||
name = "pico_btstack_base", | ||
actual = "@btstack//:pico_btstack_base", | ||
) | ||
|
||
alias( | ||
name = "pico_btstack_ble", | ||
actual = "@btstack//:pico_btstack_ble", | ||
) | ||
|
||
alias( | ||
name = "pico_btstack_classic", | ||
actual = "@btstack//:pico_btstack_classic", | ||
) | ||
|
||
alias( | ||
name = "pico_btstack_sbc_encoder", | ||
actual = "@btstack//:pico_btstack_classic", | ||
) | ||
|
||
alias( | ||
name = "pico_btstack_bnep_lwip", | ||
actual = "@btstack//:pico_btstack_bnep_lwip", | ||
) | ||
|
||
alias( | ||
name = "pico_btstack_bnep_lwip_sys_freertos", | ||
actual = "@btstack//:pico_btstack_bnep_lwip_sys_freertos", | ||
) | ||
|
||
cc_library( | ||
name = "pico_btstack", | ||
srcs = [ | ||
"btstack_flash_bank.c", | ||
"btstack_run_loop_async_context.c", | ||
"btstack_stdin_pico.c", | ||
], | ||
hdrs = [ | ||
"include/pico/btstack_flash_bank.h", | ||
"include/pico/btstack_run_loop_async_context.h", | ||
name = "pico_btstack_flash_bank", | ||
includes = ["include"], | ||
hdrs = ["include/pico/btstack_flash_bank.h"], | ||
srcs = ["btstack_flash_bank.c"], | ||
deps = [ | ||
"//src/common/pico_base", | ||
"//src/rp2_common/pico_flash", | ||
":pico_btstack_base", | ||
], | ||
target_compatible_with = select({ | ||
"//bazel/constraint:cyw43_wireless": [], | ||
"//bazel/constraint:is_pico_w": [], | ||
"//conditions:default": ["@platforms//:incompatible"], | ||
}), | ||
) | ||
|
||
cc_library( | ||
name = "btstack_run_loop_async_context", | ||
includes = ["include"], | ||
# Missing deps for: | ||
# btstack_config.h | ||
# btstack_run_loop.h | ||
# btstack_stdin.h | ||
# hal_flash_bank.h | ||
tags = ["manual"], | ||
hdrs = ["include/pico/btstack_run_loop_async_context.h"], | ||
srcs = ["btstack_run_loop_async_context.c"], | ||
deps = [ | ||
"//src/rp2_common/hardware_sync", | ||
"//src/rp2_common/pico_async_context:pico_async_context", | ||
"@btstack//:pico_btstack_base", | ||
], | ||
target_compatible_with = select({ | ||
"//bazel/constraint:rp2": [], | ||
"//bazel/constraint:cyw43_wireless": [], | ||
"//bazel/constraint:is_pico_w": [], | ||
"//conditions:default": ["@platforms//:incompatible"], | ||
}), | ||
) | ||
|
||
cc_library( | ||
name = "pico_btstack_stdin", | ||
srcs = ["btstack_stdin_pico.c"], | ||
target_compatible_with = select({ | ||
"//bazel/constraint:pico_btstack_config_unset": ["@platforms//:incompatible"], | ||
"//conditions:default": [], | ||
}) + select({ | ||
"//bazel/constraint:cyw43_wireless": [], | ||
"//bazel/constraint:is_pico_w": [], | ||
"//conditions:default": ["@platforms//:incompatible"], | ||
}), | ||
deps = [ | ||
"//src/common/pico_base", | ||
"//src/rp2_common/hardware_sync", | ||
"//src/rp2_common/pico_async_context", | ||
"//src/rp2_common/pico_flash", | ||
"//src/rp2_common/pico_stdio", | ||
], | ||
) |
Oops, something went wrong.