Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rp2040 multithreaded target support #2178

Merged
merged 5 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ CodeBuilder generateCMakeCode(

if (!targetConfig.get(SingleThreadedProperty.INSTANCE)
&& platformOptions.platform() != Platform.ZEPHYR
&& platformOptions.platform() != Platform.FLEXPRET) {
&& platformOptions.platform() != Platform.FLEXPRET
&& platformOptions.platform() != Platform.RP2040) {
// If threaded computation is requested, add the threads option.
cMakeCode.pr("# Find threads and link to it");
cMakeCode.pr("find_package(Threads REQUIRED)");
Expand Down Expand Up @@ -558,9 +559,9 @@ private static String setUpMainTargetRp2040(
code.pr("pico_sdk_init()");
code.newLine();
code.pr("add_subdirectory(core)");
code.pr("target_link_libraries(core PUBLIC pico_stdlib)");
code.pr("target_link_libraries(core PUBLIC pico_multicore)");
code.pr("target_link_libraries(core PUBLIC pico_sync)");
code.pr("target_link_libraries(reactor-c PUBLIC pico_stdlib)");
code.pr("target_link_libraries(reactor-c PUBLIC pico_multicore)");
code.pr("target_link_libraries(reactor-c PUBLIC pico_sync)");
edwardalee marked this conversation as resolved.
Show resolved Hide resolved
code.newLine();
code.pr("set(LF_MAIN_TARGET " + executableName + ")");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ protected PlatformOptions fromString(String string, MessageReporter reporter) {
public void validate(TargetConfig config, MessageReporter reporter) {
var platform = config.get(PlatformProperty.INSTANCE).platform;
switch (platform) {
case RP2040:
validateRP2040(config, reporter);
break;
case FLEXPRET:
validateFlexPRET(config, reporter);
break;
Expand All @@ -129,15 +126,6 @@ public void validate(TargetConfig config, MessageReporter reporter) {
}
}

private void validateRP2040(TargetConfig config, MessageReporter reporter) {
var singleThreaded = config.get(SingleThreadedProperty.INSTANCE);
if (!singleThreaded) {
reporter
.at(config.lookup(this), Literals.KEY_VALUE_PAIR__VALUE)
.error("Platform " + Platform.RP2040 + " does not support threading.");
}
}

private void validateFlexPRET(TargetConfig config, MessageReporter reporter) {
var platform = config.get(PlatformProperty.INSTANCE);
var board = platform.board();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum Platform {
AUTO,
ARDUINO, // FIXME: not multithreaded
NRF52("Nrf52", true),
RP2040("Rp2040", false),
RP2040("Rp2040", true),
LINUX("Linux", true),
MAC("Darwin", true),
ZEPHYR("Zephyr", true),
Expand Down
Loading