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

Support for Arduino platforms #1272

Merged
merged 71 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
40c2b28
Added Preliminary Support to LF-Compiler for Arduino
arengarajan99 Jun 19, 2022
b38da81
Added Additional Patches to CGenerator to successfully compile LFC
arengarajan99 Jun 22, 2022
ff3c985
Revert "Added Additional Patches to CGenerator to successfully compil…
arengarajan99 Jun 22, 2022
56a893a
Revert "Added Preliminary Support to LF-Compiler for Arduino"
arengarajan99 Jun 22, 2022
1bb8a54
Merge branch 'master' into arduino-support
arengarajan99 Jun 25, 2022
7ebba86
Updated submodules
arengarajan99 Jun 27, 2022
88b34d4
Updated Submodules
arengarajan99 Jun 27, 2022
6734802
Added Initial Arduino Support to LFC
arengarajan99 Jun 27, 2022
2ff70b9
Added Additional Platform Support to LFC
arengarajan99 Jul 3, 2022
f0acad0
Added Additional Attributes for Testing
arengarajan99 Jul 3, 2022
6de0586
Fixed bug with printing messages prior to beginning serial
arengarajan99 Jul 3, 2022
1115a1e
Removed Unnecessary Serial Statement due to auto-initialization
arengarajan99 Jul 3, 2022
759c592
Add spacing for better styling.
arengarajan99 Jul 3, 2022
ace19cd
Updated Blink.lf Preamble Comment
arengarajan99 Jul 3, 2022
dee0271
Merge branch 'master' into arduino-support
arengarajan99 Jul 4, 2022
d175eab
Merge branch 'arduino-support' of https://github.com/lf-lang/lingua-f…
arengarajan99 Jul 4, 2022
5b6b4b0
Reverted reactor-cpp for arduino-support branch
arengarajan99 Jul 5, 2022
ca17f69
Add Arduino CMake Toolchain as Submodule Dependency to lingua-franca
arengarajan99 Jul 7, 2022
6e63d2d
Remove Target Configurations for microsec/32 bit support since unused
arengarajan99 Jul 7, 2022
ac1c495
Update Submodule Dependency on Reactor-C
arengarajan99 Jul 20, 2022
c35f674
Changing Suffix of Arduino Files to Match Working Test Case
arengarajan99 Jul 20, 2022
c62bf60
Update CCmakeGenerator to reflect new CMakeFiles
arengarajan99 Jul 20, 2022
fdbde25
Added Arduino File Support to Test Suite
arengarajan99 Jul 20, 2022
a1086de
Merge branch 'master' into arduino-support
arengarajan99 Jul 20, 2022
9ec3668
Updated Submodules
arengarajan99 Jul 20, 2022
1735918
Set Board back to a default Arduino board
arengarajan99 Jul 20, 2022
5738e15
Testing Arduino CLI integration with CMake
arengarajan99 Jul 20, 2022
c3b27bd
Continue Testing Arduino-CLI integration
arengarajan99 Jul 20, 2022
3bc0546
Move location of downloading Arduino CLI
arengarajan99 Jul 20, 2022
dd87cb6
Removed support outside MacOS for moment.
arengarajan99 Jul 20, 2022
800baf7
Additional tweaks to Arduino Tests
arengarajan99 Jul 23, 2022
7cde714
Fixed arduino tests to exclude windows and linux testing
arengarajan99 Jul 25, 2022
500e65d
Merge branch 'master' into arduino-support
arengarajan99 Jul 25, 2022
f569085
update submodule dependency.
arengarajan99 Jul 25, 2022
6657eba
Add Preliminary Linux Support for Arduino Testing
arengarajan99 Jul 25, 2022
1f54a24
Add back Linux Support for Arduino
arengarajan99 Jul 25, 2022
e5c0bc5
Update ci.yml for testing
arengarajan99 Jul 25, 2022
53a193b
Added additional code to bypass certain tests for Arduino.
arengarajan99 Jul 25, 2022
7ca961a
Revert fix to Arduino that broke test.
arengarajan99 Jul 25, 2022
3fede54
Update submodule dependency on Reactor-C
arengarajan99 Jul 26, 2022
5622d86
Added More Arduino Tests + Converted Arduino to CCpp Target
arengarajan99 Jul 26, 2022
ddfc40e
Removed Threading Specification for building on Arduino Platform
arengarajan99 Jul 26, 2022
ac27689
Added option for baud-rate specification in configuration
arengarajan99 Jul 26, 2022
d1d476b
Update Broken Submodule Dependencies
arengarajan99 Jul 26, 2022
960e463
Clean up testing artifacts.
arengarajan99 Jul 26, 2022
df82e53
Additional patch to fix CMakeLists.txt from double including platform…
arengarajan99 Jul 26, 2022
18a1d56
Extra Cleanup with move to CCpp Target
arengarajan99 Jul 26, 2022
243c248
Additional Cleanup
arengarajan99 Jul 26, 2022
5871e34
Merge branch 'master' into arduino-support
arengarajan99 Jul 26, 2022
bd54f51
Add back removed comment.
arengarajan99 Jul 26, 2022
8535ee2
Fixed formatting of CCompiler.java file
arengarajan99 Jul 26, 2022
9297245
Moved location of BoardOptions copyfile under the try-catch method.
arengarajan99 Jul 26, 2022
3f11746
Cleaned up tests + Added warning if user attempts to enable threading.
arengarajan99 Jul 26, 2022
e927feb
Update reactor-ts
arengarajan99 Aug 8, 2022
2c3475a
Merge branch 'master' into arduino-support
arengarajan99 Aug 15, 2022
1031f01
Changed GRAN_MICRO to MICROSECOND_TIME
arengarajan99 Aug 15, 2022
b9b1181
Update Submodule Dependency
arengarajan99 Aug 15, 2022
aa8a108
Reformat sections.
arengarajan99 Aug 15, 2022
b898ffe
Removed Arduino from threading off exclusion list.
arengarajan99 Aug 15, 2022
998c363
Fixed small bug
arengarajan99 Aug 15, 2022
1715856
Remove Arduino from CCpp exclusion since we use CCpp target
arengarajan99 Aug 15, 2022
f131d6e
Couple together TestCategory and TestLevel to make Arduino tests run …
arengarajan99 Aug 16, 2022
675dbb5
Fixed CI to work for C/Cpp Arduino Tests
arengarajan99 Aug 16, 2022
bc7a891
Exclude Arduino Test Cases from CCpp test on Windows
arengarajan99 Aug 16, 2022
f9feb33
Add check to prevent running Arduino tests on Windows till CCpp suppo…
arengarajan99 Aug 16, 2022
d3a14be
Update submodule dependencies from master
arengarajan99 Aug 25, 2022
6e34bb5
Merge pull request #1335 from lf-lang/master
arengarajan99 Aug 25, 2022
bcbb4f7
Apply suggestions from code review
lhstrh Aug 26, 2022
d1bc156
Fixed comments and cleaned up line width.
arengarajan99 Aug 29, 2022
0ab9cb3
Merge pull request #1339 from lf-lang/master
arengarajan99 Aug 30, 2022
c4249c8
Merge pull request #1340 from lf-lang/master
arengarajan99 Aug 31, 2022
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
[submodule "org.lflang/src/lib/cpp/reactor-cpp"]
path = org.lflang/src/lib/cpp/reactor-cpp
url = https://github.com/lf-lang/reactor-cpp
[submodule "org.lflang/src/lib/platform/arduino/Arduino-CMake-Toolchain"]
path = org.lflang/src/lib/platform/arduino/Arduino-CMake-Toolchain
url = https://github.com/a9183756-gh/Arduino-CMake-Toolchain.git
Soroosh129 marked this conversation as resolved.
Show resolved Hide resolved
[submodule "org.lflang/src/lib/rs/reactor-rs"]
path = org.lflang/src/lib/rs/reactor-rs
url = [email protected]:lf-lang/reactor-rs.git
8 changes: 8 additions & 0 deletions org.lflang.tests/src/org/lflang/tests/RuntimeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ public void runConcurrentTests() {

}

@Test
public void runArduinoTests() {
runTestsFor(List.of(Target.C),
Message.DESC_ARDUINO,
TestCategory.ARDUINO::equals, Configurators::noChanges, TestLevel.BUILD,
false);
}

@Test
public void runFederatedTests() {
Assumptions.assumeTrue(supportsFederatedExecution(), Message.NO_FEDERATION_SUPPORT);
Expand Down
7 changes: 6 additions & 1 deletion org.lflang.tests/src/org/lflang/tests/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
Expand Down Expand Up @@ -134,6 +135,7 @@ public static class Message {
public static final String DESC_DOCKER_FEDERATED = "Run docker federated tests.";
public static final String DESC_CONCURRENT = "Run concurrent tests.";
public static final String DESC_TARGET_SPECIFIC = "Run target-specific tests";
public static final String DESC_ARDUINO = "Running Arduino tests.";
public static final String DESC_AS_CCPP = "Running C tests as CCpp.";
public static final String DESC_SINGLE_THREADED = "Run non-concurrent and non-federated tests with threading = off.";
public static final String DESC_SCHED_SWAPPING = "Running with non-default runtime scheduler ";
Expand Down Expand Up @@ -463,7 +465,10 @@ private GeneratorResult generateCode(LFTest test) {
private void execute(LFTest test, GeneratorResult generatorResult) {
final List<ProcessBuilder> pbList = getExecCommand(test, generatorResult);
if (pbList.isEmpty()) {
return;
var srcBasePath = test.fileConfig.srcPkgPath.resolve("src");
if (!srcBasePath.relativize(test.fileConfig.srcPath).toString().equalsIgnoreCase(TestCategory.ARDUINO.getPath())) {
return;
}
}
try {
for (ProcessBuilder pb : pbList) {
Expand Down
1 change: 1 addition & 0 deletions org.lflang.tests/src/org/lflang/tests/TestRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public enum TestCategory {
DOCKER(true),
DOCKER_FEDERATED(true, "docker" + File.separator + "federated"),
SERIALIZATION(false),
ARDUINO(false),
TARGET(false);

/**
Expand Down
6 changes: 6 additions & 0 deletions org.lflang.tests/src/org/lflang/tests/runtime/CTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public void runMultiportTests() {
super.runMultiportTests();
}

@Test
@Override
public void runArduinoTests() {
super.runArduinoTests();
}

@Test
@Override
public void runWithThreadingOff() {
Expand Down
1 change: 0 additions & 1 deletion org.lflang/src/org/lflang/TargetConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ public class TargetConfig {
*/
public boolean exportToYaml = false;


/** Rust-specific configuration. */
public final RustTargetConfig rust = new RustTargetConfig();

Expand Down
1 change: 1 addition & 0 deletions org.lflang/src/org/lflang/TargetProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ public String toString() {
*/
public enum Platform {
AUTO,
ARDUINO("Arduino"),
LINUX("Linux"),
MAC("Darwin"),
WINDOWS("Windows");
Expand Down
18 changes: 15 additions & 3 deletions org.lflang/src/org/lflang/generator/c/CCmakeCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@

package org.lflang.generator.c;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -40,6 +42,8 @@
import org.lflang.util.FileUtil;
import org.lflang.util.LFCommand;

import org.lflang.TargetProperty.Platform;


/**
* Responsible for creating and executing the necessary CMake command to compile code that is generated
Expand Down Expand Up @@ -108,6 +112,11 @@ public boolean runCCompiler(
// Make sure the build directory exists
Files.createDirectories(buildPath);

// If we are running an Arduino Target, need to copy over the BoardOptions file.
if(targetConfig.platform == Platform.ARDUINO) {
FileUtil.copyFile(FileUtil.globFilesEndsWith(fileConfig.srcPath, "BoardOptions.cmake").get(0), Paths.get(buildPath.toString(), File.separator, "BoardOptions.cmake"));
arengarajan99 marked this conversation as resolved.
Show resolved Hide resolved
}

LFCommand compile = compileCmakeCommand(file, noBinary);
if (compile == null) {
return false;
Expand Down Expand Up @@ -146,7 +155,6 @@ public boolean runCCompiler(
LFCommand build = buildCmakeCommand(file, noBinary);

makeReturnCode = build.run(context.getCancelIndicator());

if (makeReturnCode != 0 &&
context.getMode() == LFGeneratorContext.Mode.STANDALONE &&
!outputContainsKnownCMakeErrors(build.getErrors().toString())) {
Expand All @@ -161,8 +169,7 @@ public boolean runCCompiler(
generator.reportCommandErrors(build.getErrors().toString());
}


if (makeReturnCode == 0 && build.getErrors().toString().length() == 0) {
if (makeReturnCode == 0 && (build.getErrors().toString().length() == 0 || targetConfig.platform == Platform.ARDUINO)) {
System.out.println("SUCCESS: Compiling generated code for "+ fileConfig.name +" finished with no errors.");
}

Expand Down Expand Up @@ -197,6 +204,11 @@ public LFCommand compileCmakeCommand(
FileUtil.toUnixString(fileConfig.getSrcGenPath())
));

if(targetConfig.platform == Platform.ARDUINO) {
arguments.add(0, "-DCMAKE_TOOLCHAIN_FILE="
+ FileUtil.globFilesEndsWith(fileConfig.srcPkgPath.getParent().getParent(), "Arduino-toolchain.cmake").get(1));
arengarajan99 marked this conversation as resolved.
Show resolved Hide resolved
}

if (GeneratorUtils.isHostWindows()) {
arguments.add("-DCMAKE_SYSTEM_VERSION=\"10.0\"");
}
Expand Down
34 changes: 23 additions & 11 deletions org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,24 @@ CodeBuilder generateCMakeCode(
cMakeCode.newLine();

cMakeCode.pr("cmake_minimum_required(VERSION 3.13)");
cMakeCode.pr("project("+executableName+" LANGUAGES C)");
cMakeCode.newLine();

cMakeCode.pr("# Require C11");
cMakeCode.pr("set(CMAKE_C_STANDARD 11)");
cMakeCode.pr("set(CMAKE_C_STANDARD_REQUIRED ON)");
if(this.targetConfig.platform == Platform.ARDUINO){
cMakeCode.pr("project("+executableName+" CXX)");
}else{
cMakeCode.pr("project("+executableName+" LANGUAGES C)");
}
cMakeCode.newLine();

cMakeCode.pr("# Require C++17");
cMakeCode.pr("set(CMAKE_CXX_STANDARD 17)");
cMakeCode.pr("set(CMAKE_CXX_STANDARD_REQUIRED ON)");
cMakeCode.newLine();
if(this.targetConfig.platform != Platform.ARDUINO) {
cMakeCode.pr("# Require C11");
cMakeCode.pr("set(CMAKE_C_STANDARD 11)");
cMakeCode.pr("set(CMAKE_C_STANDARD_REQUIRED ON)");
cMakeCode.newLine();

cMakeCode.pr("# Require C++17");
cMakeCode.pr("set(CMAKE_CXX_STANDARD 17)");
cMakeCode.pr("set(CMAKE_CXX_STANDARD_REQUIRED ON)");
cMakeCode.newLine();
}
// Set the build type
cMakeCode.pr("set(DEFAULT_BUILD_TYPE " + targetConfig.cmakeBuildType + ")\n");
cMakeCode.pr("if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)\n");
Expand All @@ -129,7 +134,9 @@ CodeBuilder generateCMakeCode(

cMakeCode.pr("include_directories(${CoreLib})");
cMakeCode.pr("include_directories(${CoreLib}/platform)");
cMakeCode.pr("include_directories(${CoreLib}/federated)");
if(this.targetConfig.platform != Platform.ARDUINO) {
cMakeCode.pr("include_directories(${CoreLib}/federated)");
}
cMakeCode.newLine();

cMakeCode.pr("set(LF_MAIN_TARGET "+executableName+")");
Expand Down Expand Up @@ -242,6 +249,11 @@ CodeBuilder generateCMakeCode(
cMakeCode.pr(")");
cMakeCode.newLine();

if(this.targetConfig.platform == Platform.ARDUINO) {
arengarajan99 marked this conversation as resolved.
Show resolved Hide resolved
cMakeCode.pr("target_link_arduino_libraries ( ${LF_MAIN_TARGET} PRIVATE core)");
cMakeCode.pr("target_enable_arduino_upload(${LF_MAIN_TARGET})");
}

// Add the include file
for (String includeFile : targetConfig.cmakeIncludesWithoutPath) {
cMakeCode.pr("include(\""+includeFile+"\")");
Expand Down
9 changes: 5 additions & 4 deletions org.lflang/src/org/lflang/generator/c/CCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package org.lflang.generator.c;

import java.io.IOException;
import java.lang.annotation.Target;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand All @@ -38,6 +39,7 @@
import org.lflang.generator.LFGeneratorContext;
import org.lflang.util.FileUtil;
import org.lflang.util.LFCommand;
import org.lflang.TargetProperty.Platform;;

/**
* Responsible for creating and executing the necessary native command to compile code that is generated
Expand Down Expand Up @@ -160,7 +162,7 @@ public LFCommand compileCCommand(
boolean noBinary
) {

String cFilename = getTargetFileName(fileToCompile, CppMode);
String cFilename = getTargetFileName(fileToCompile, CppMode, targetConfig);

Path relativeSrcPath = fileConfig.getOutPath().relativize(
fileConfig.getSrcGenPath().resolve(Paths.get(cFilename)));
Expand Down Expand Up @@ -233,9 +235,8 @@ public LFCommand compileCCommand(
* In C++ mode, the compiler produces .cpp files instead
* of .c files and uses a C++ compiler to compiler the code.
*/
static String getTargetFileName(String fileName, boolean CppMode) {
if (CppMode) {
// If the C++ mode is enabled, use a .cpp extension
static String getTargetFileName(String fileName, boolean CppMode, TargetConfig targetConfig) {
if(targetConfig.platform == Platform.ARDUINO || CppMode) {
return fileName + ".cpp";
}
return fileName + ".c";
Expand Down
8 changes: 8 additions & 0 deletions org.lflang/src/org/lflang/generator/c/CCoreFilesUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public static List<String> getCTargetSrc() {
);
}

public static List<String> getArduinoTargetHeaders() {
return List.of(
"Arduino.h"
);
}

public static List<String> getCTargetHeader() {
return List.of(
"include/ctarget/ctarget.h"
Expand Down Expand Up @@ -93,6 +99,8 @@ private static List<String> getPlatformFiles() {
"platform/lf_macos_support.h",
"platform/lf_windows_support.c",
"platform/lf_windows_support.h",
"platform/lf_arduino_support.cpp",
"platform/lf_arduino_support.h",
"platform/lf_linux_support.c",
"platform/lf_linux_support.h"
);
Expand Down
11 changes: 9 additions & 2 deletions org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public void doGenerate(Resource resource, LFGeneratorContext context) {
generateCodeForCurrentFederate(lfModuleName);

// Derive target filename from the .lf filename.
var cFilename = CCompiler.getTargetFileName(lfModuleName, this.CCppMode);
var cFilename = CCompiler.getTargetFileName(lfModuleName, this.CCppMode, this.targetConfig);
var targetFile = fileConfig.getSrcGenPath() + File.separator + cFilename;
try {
if (isFederated) {
Expand Down Expand Up @@ -1086,7 +1086,14 @@ private void pickCompilePlatform() {
if (targetConfig.platform != Platform.AUTO) {
osName = targetConfig.platform.toString();
}
if (osName.contains("mac") || osName.contains("darwin")) {

if (osName.contains("arduino")) {
if (mainDef != null) {
targetConfig.compileAdditionalSources.add(
"core" + File.separator + "platform" + File.separator + "lf_arduino_support.cpp"
);
}
} else if (osName.contains("mac") || osName.contains("darwin")) {
if (mainDef != null && !targetConfig.useCmake) {
targetConfig.compileAdditionalSources.add(
"core" + File.separator + "platform" + File.separator + "lf_macos_support.c"
Expand Down
16 changes: 16 additions & 0 deletions org.lflang/src/org/lflang/generator/c/CMainGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.lflang.TargetConfig;
import org.lflang.generator.CodeBuilder;
import org.lflang.util.StringUtil;
import org.lflang.TargetProperty.Platform;

public class CMainGenerator {
private TargetConfig targetConfig;
Expand Down Expand Up @@ -36,6 +37,21 @@ public String generateCode() {
* Generate the `main` function.
*/
private String generateMainFunction() {
if (targetConfig.platform == Platform.ARDUINO) {
/**
FIXME: Add configurations for two scenarios:
- Logging
- Baud Rate
lhstrh marked this conversation as resolved.
Show resolved Hide resolved
*/
return String.join("\n",
"// Arduino setup() and loop() functions",
"void setup() {",
"Serial.begin(9600); //TODO: Enable Serial by default, have option to disable. Have option to specify baud rate (9600 by default)",
"lf_reactor_c_main(0, NULL);",
"}",
"void loop() {}"
);
}
return String.join("\n",
"int main(int argc, char* argv[]) {",
" return lf_reactor_c_main(argc, argv);",
Expand Down
13 changes: 13 additions & 0 deletions org.lflang/src/org/lflang/generator/c/CPreambleGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.lflang.TargetConfig;
import org.lflang.TargetConfig.ClockSyncOptions;
import org.lflang.TargetProperty.Platform;
import org.lflang.TargetProperty.ClockSyncMode;
import org.lflang.TargetProperty.CoordinationType;
import org.lflang.generator.CodeBuilder;
Expand Down Expand Up @@ -36,6 +37,11 @@ public static String generateIncludeStatements(
) {
var tracing = targetConfig.tracing;
CodeBuilder code = new CodeBuilder();
if(targetConfig.platform == Platform.ARDUINO) {
CCoreFilesUtils.getArduinoTargetHeaders().forEach(
it -> code.pr("#include " + StringUtil.addDoubleQuotes(it))
);
}
CCoreFilesUtils.getCTargetHeader().forEach(
it -> code.pr("#include " + StringUtil.addDoubleQuotes(it))
);
Expand Down Expand Up @@ -70,6 +76,12 @@ public static String generateDefineDirectives(
CodeBuilder code = new CodeBuilder();
code.pr("#define LOG_LEVEL " + logLevel);
code.pr("#define TARGET_FILES_DIRECTORY " + addDoubleQuotes(srcGenPath.toString()));

//TODO: Define Global Support for 32-bit and Microsecond Granularity on Reactor-C
arengarajan99 marked this conversation as resolved.
Show resolved Hide resolved
if(targetConfig.platform == Platform.ARDUINO) {
arengarajan99 marked this conversation as resolved.
Show resolved Hide resolved
lhstrh marked this conversation as resolved.
Show resolved Hide resolved
code.pr("#define GRAN_MICRO");
code.pr("#define BIT_32");
}
if (isFederated) {
code.pr("#define NUMBER_OF_FEDERATES " + numFederates);
code.pr(generateFederatedDefineDirective(coordinationType));
Expand All @@ -90,6 +102,7 @@ public static String generateDefineDirectives(
targetConfig.clockSyncOptions
));
}
code.newLine();
return code.toString();
}

Expand Down
Loading