Skip to content

Commit

Permalink
Merge pull request #2178 from lf-lang/rp2040-multicore
Browse files Browse the repository at this point in the history
Rp2040 multithreaded target support
  • Loading branch information
lhstrh authored Jun 5, 2024
2 parents a3c682e + 8eb0a15 commit f8008c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
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
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", false),
RP2040("Rp2040", false),
RP2040("Rp2040", true),
LINUX("Linux", true),
MAC("Darwin", true),
ZEPHYR("Zephyr", true),
Expand Down

0 comments on commit f8008c4

Please sign in to comment.