diff --git a/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java b/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java index 26198b3b47..f589edd084 100644 --- a/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java +++ b/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java @@ -1547,6 +1547,15 @@ public void recognizeHostNames() throws Exception { List.of("[foo, {bar: baz}]", "[1]", PrimitiveType.STRING), List.of("{bar: baz}", "", UnionType.STRING_OR_STRING_ARRAY) ), + UnionType.PLATFORM_STRING_OR_DICTIONARY, List.of( + List.of("[bar, baz]", "", UnionType.PLATFORM_STRING_OR_DICTIONARY), + List.of("{name: [1, 2, 3]}", ".name", PrimitiveType.STRING), + List.of("{name: {bar: baz}}", ".name", PrimitiveType.STRING), + List.of("{board: [1, 2, 3]}", ".board", PrimitiveType.STRING), + List.of("{board: {bar: baz}}", ".board", PrimitiveType.STRING), + List.of("{baud-rate: [1, 2, 3]}", ".baud-rate", PrimitiveType.NON_NEGATIVE_INTEGER), + List.of("{baud-rate: {bar: baz}}", ".baud-rate", PrimitiveType.NON_NEGATIVE_INTEGER) + ), UnionType.FILE_OR_FILE_ARRAY, List.of( List.of("[1 msec]", "[0]", PrimitiveType.FILE), List.of("[foo, {bar: baz}]", "[1]", PrimitiveType.FILE), diff --git a/org.lflang/src/org/lflang/TargetConfig.java b/org.lflang/src/org/lflang/TargetConfig.java index 9af1593a22..be6a5094f7 100644 --- a/org.lflang/src/org/lflang/TargetConfig.java +++ b/org.lflang/src/org/lflang/TargetConfig.java @@ -53,11 +53,6 @@ public class TargetConfig { */ public Set setByUser = new HashSet<>(); - /** - * Specify Baud Rate for Embedded Devices, including Arduino. - */ - public int baudRate = 9600; - /** * A list of custom build commands that replace the default build process of * directly invoking a designated compiler. A common usage of this target @@ -195,13 +190,17 @@ public class TargetConfig { public boolean noRuntimeValidation = false; /** - * Set the target platform. + * Set the target platform config. * This tells the build system what platform-specific support * files it needs to incorporate at compile time. + * + * This is now a wrapped class to account for overloaded definitions + * of defining platform (either a string or dictionary of values) * * @author Samuel Berkun (sberkun@berkeley.edu) + * @author Anirudh Rengarajan (arengarajan@berkeley.edu) */ - public Platform platform = Platform.AUTO; + public PlatformOptions platformOptions = new PlatformOptions(); /** * List of proto files to be processed by the code generator. @@ -346,6 +345,89 @@ public static class DockerOptions { public String from = "alpine:latest"; } + /** + * Enum representing the different boards supported by Arduino-CMake and future embedded boards. + */ + public enum Board { + NONE(), + YN("Arduino Yn [avr.yun]"), + UNO("Arduino Uno [avr.uno]"), + DUEMILANOVE("Arduino Duemilanove or Diecimila [avr.diecimila]"), + DIECIMILA("Arduino Duemilanove or Diecimila [avr.diecimila]"), + NANO("Arduino Nano [avr.nano]"), + MEGA("Arduino Mega or Mega 2560 [avr.mega]"), + MEGA_2560("Arduino Mega or Mega 2560 [avr.mega]"), + MEGA_ADK("Arduino Mega ADK [avr.megaADK]"), + LEONARDO("Arduino Leonardo [avr.leonardo]"), + LEONARDO_ETH("Arduino Leonardo ETH [avr.leonardoeth]"), + MICRO("Arduino Micro [avr.micro]"), + ESPLORA("Arduino Esplora [avr.esplora]"), + MINI("Arduino Mini [avr.mini]"), + ETHERNET("Arduino Ethernet [avr.ethernet]"), + FIO("Arduino Fio [avr.fio]"), + BT("Arduino BT [avr.bt]"), + LILYPAD_USB("LilyPad Arduino USB [avr.LilyPadUSB]"), + LILYPAD("LilyPad Arduino [avr.lilypad]"), + PRO("Arduino Pro or Pro Mini [avr.pro]"), + PRO_MINI("Arduino Pro or Pro Mini [avr.pro]"), + NG("Arduino NG or older [avr.atmegang]"), + OLDER("Arduino NG or older [avr.atmegang]"), + ROBOT_CONTROL("Arduino Robot Control [avr.robotControl]"), + ROBOT_MOTOR("Arduino Robot Motor [avr.robotMotor]"), + GEMMA("Arduino Gemma [avr.gemma]"), + CIRCUIT_PLAYGROUND("Adafruit Circuit Playground [avr.circuitplay32u4cat]"), + YN_MINI("Arduino Yn Mini [avr.yunmini]"), + INDUSTRIAL_101("Arduino Industrial 101 [avr.chiwawa]"), + LININO_ONE("Linino One [avr.one]"), + UNO_WIFI("Arduino Uno WiFi [avr.unowifi]"), + SAM_DUE_PROG("Arduino Due (Programming Port) [sam.arduino_due_x_dbg]"), + SAM_DUE_NATIVE("Arduino Due (Native USB Port) [sam.arduino_due_x]"); + + String boardName; + Board() { + this.boardName = this.toString(); + } + Board(String boardName) { + this.boardName = boardName; + } + + /** + * Return the name in lower case. + */ + @Override + public String toString() { + return this.name().toLowerCase(); + } + + /** + * Get the CMake name for the platform. + */ + public String getBoardName() { + return this.boardName; + } + } + + /** + * Settings related to Platform Options. + */ + public static class PlatformOptions { + + /** + * The base platform we build our LF Files on. Should be set to AUTO by default unless developing for specific OS/Embedded Platform + */ + public Platform platform = Platform.AUTO; + + /** + * The base board we target when building LF on Arduino/Embedded Boards. For OS development and generic embedded systems, this value is unused. + */ + public Board board = Board.UNO; + + /** + * The baud rate used as a parameter to certain embedded platforms. 9600 is a standard rate amongst systems like Arduino, so it's the default value. + */ + public int baudRate = 9600; + } + /** * Settings related to tracing options. */ diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index 05a1801900..50b5b9a4ff 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -34,7 +34,9 @@ import java.util.stream.Collectors; import org.eclipse.xtext.util.RuntimeIOException; +import org.lflang.TargetConfig.Board; import org.lflang.TargetConfig.DockerOptions; +import org.lflang.TargetConfig.PlatformOptions; import org.lflang.TargetConfig.TracingOptions; import org.lflang.generator.InvalidLfSourceException; import org.lflang.generator.rust.CargoDependencySpec; @@ -57,14 +59,6 @@ */ public enum TargetProperty { - /** - * Directive to specify the baud-rate used by the runtime for embedded systems (Arduino). - */ - BAUD_RATE("baud-rate", PrimitiveType.NON_NEGATIVE_INTEGER, - List.of(Target.C, Target.CCPP), - (config, value, err) -> { - config.baudRate = ASTUtils.toInteger(value); - }), /** * Directive to let the generator use the custom build command. @@ -308,13 +302,51 @@ public enum TargetProperty { }), /** - * Directive to specify the platform for cross code generation. + * Directive to specify the platform for cross code generation. This is either a string of the platform + * or a dictionary of options that includes the string name. */ - PLATFORM("platform", UnionType.PLATFORM_UNION, Target.ALL, - (config, value, err) -> { - config.platform = (Platform) UnionType.PLATFORM_UNION - .forName(ASTUtils.elementToSingleString(value)); - }), + PLATFORM("platform", UnionType.PLATFORM_STRING_OR_DICTIONARY, Target.ALL, + (config, value, err) -> { + if (value.getLiteral() != null) { + config.platformOptions = new PlatformOptions(); + config.platformOptions.platform = (Platform) UnionType.PLATFORM_UNION + .forName(ASTUtils.elementToSingleString(value)); + } else { + config.platformOptions= new PlatformOptions(); + for (KeyValuePair entry : value.getKeyvalue().getPairs()) { + PlatformOption option = (PlatformOption) DictionaryType.PLATFORM_DICT + .forName(entry.getName()); + switch (option) { + case NAME: + Platform p = (Platform) UnionType.PLATFORM_UNION + .forName(ASTUtils.elementToSingleString(entry.getValue())); + if(p == null){ + String s = "Unidentified Platform Type, LF supports the following platform types: " + Arrays.asList(Platform.values()).toString(); + err.reportError(s); + throw new AssertionError(s); + } + config.platformOptions.platform = p; + break; + case BAUDRATE: + config.platformOptions.baudRate = ASTUtils.toInteger(entry.getValue()); + break; + case BOARD: + Board b = (Board) UnionType.BOARD_UNION + .forName(ASTUtils.elementToSingleString(entry.getValue())); + if(b == null){ + String s = "Unidentified Board Type, LF supports the following board types: " + Arrays.asList(Board.values()).toString(); + err.reportError(s); + throw new AssertionError(s); + } + + config.platformOptions.board = b; + break; + default: + break; + } + } + } + }), /** * Directive for specifying .proto files that need to be compiled and their @@ -722,6 +754,7 @@ public interface DictionaryElement { public enum DictionaryType implements TargetPropertyType { CLOCK_SYNC_OPTION_DICT(Arrays.asList(ClockSyncOption.values())), DOCKER_DICT(Arrays.asList(DockerOption.values())), + PLATFORM_DICT(Arrays.asList(PlatformOption.values())), COORDINATION_OPTION_DICT(Arrays.asList(CoordinationOption.values())), TRACING_DICT(Arrays.asList(TracingOption.values())); @@ -811,6 +844,9 @@ public enum UnionType implements TargetPropertyType { STRING_OR_STRING_ARRAY( Arrays.asList(PrimitiveType.STRING, ArrayType.STRING_ARRAY), null), + PLATFORM_STRING_OR_DICTIONARY( + Arrays.asList(PrimitiveType.STRING, DictionaryType.PLATFORM_DICT), + null), FILE_OR_FILE_ARRAY( Arrays.asList(PrimitiveType.FILE, ArrayType.FILE_ARRAY), null), BUILD_TYPE_UNION(Arrays.asList(BuildType.values()), null), @@ -819,6 +855,7 @@ public enum UnionType implements TargetPropertyType { SCHEDULER_UNION(Arrays.asList(SchedulerOption.values()), SchedulerOption.getDefault()), LOGGING_UNION(Arrays.asList(LogLevel.values()), LogLevel.INFO), PLATFORM_UNION(Arrays.asList(Platform.values()), Platform.AUTO), + BOARD_UNION(Arrays.asList(Board.values()), Board.NONE), CLOCK_SYNC_UNION(Arrays.asList(ClockSyncMode.values()), ClockSyncMode.INIT), DOCKER_UNION(Arrays.asList(PrimitiveType.BOOLEAN, DictionaryType.DOCKER_DICT), @@ -1285,6 +1322,42 @@ public TargetPropertyType getType() { } } + + /** + * Platform options. + * @author{Anirudh Rengarajan } + */ + public enum PlatformOption implements DictionaryElement { + NAME("name", PrimitiveType.STRING), + BAUDRATE("baud-rate", PrimitiveType.NON_NEGATIVE_INTEGER), + BOARD("board", PrimitiveType.STRING); + + public final PrimitiveType type; + + private final String description; + + private PlatformOption(String alias, PrimitiveType type) { + this.description = alias; + this.type = type; + } + + + /** + * Return the description of this dictionary element. + */ + @Override + public String toString() { + return this.description; + } + + /** + * Return the type associated with this dictionary element. + */ + public TargetPropertyType getType() { + return this.type; + } + } + /** * Coordination options. * @author{Edward A. Lee } diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeCompiler.java b/org.lflang/src/org/lflang/generator/c/CCmakeCompiler.java index 69347ff84e..dc6e53e1fd 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeCompiler.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeCompiler.java @@ -199,11 +199,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(0)); - arguments.add(0, "-DARDUINO_BOARD_OPTIONS_FILE=" - + FileUtil.globFilesEndsWith(fileConfig.getSrcGenPath(), "BoardOptions.cmake").get(0)); + if(targetConfig.platformOptions.platform == Platform.ARDUINO) { + arguments.add("-DCMAKE_TOOLCHAIN_FILE=" + + fileConfig.getSrcGenPath().resolve("toolchain/Arduino-toolchain.cmake")); + arguments.add("-DARDUINO_BOARD_OPTIONS_FILE=" + + fileConfig.getSrcGenPath().resolve("toolchain/BoardOptions.cmake")); } if (GeneratorUtils.isHostWindows()) { diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index e1eb841fb4..5a6e574955 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -121,8 +121,8 @@ CodeBuilder generateCMakeCode( cMakeCode.newLine(); } - if (targetConfig.platform != Platform.AUTO) { - cMakeCode.pr("set(CMAKE_SYSTEM_NAME "+targetConfig.platform.getcMakeName()+")"); + if (targetConfig.platformOptions.platform != Platform.AUTO) { + cMakeCode.pr("set(CMAKE_SYSTEM_NAME "+targetConfig.platformOptions.platform.getcMakeName()+")"); } cMakeCode.pr("include(${CoreLib}/platform/Platform.cmake)"); cMakeCode.newLine(); @@ -242,8 +242,8 @@ CodeBuilder generateCMakeCode( cMakeCode.pr(")"); cMakeCode.newLine(); - if (this.targetConfig.platform == Platform.ARDUINO) { - cMakeCode.pr("target_link_arduino_libraries ( ${LF_MAIN_TARGET} PRIVATE core)"); + if (this.targetConfig.platformOptions.platform == Platform.ARDUINO) { + cMakeCode.pr("target_link_arduino_libraries ( ${LF_MAIN_TARGET} AUTO_PUBLIC)"); cMakeCode.pr("target_enable_arduino_upload(${LF_MAIN_TARGET})"); } diff --git a/org.lflang/src/org/lflang/generator/c/CGenerator.java b/org.lflang/src/org/lflang/generator/c/CGenerator.java index 22f39bf0e4..fe5232050a 100644 --- a/org.lflang/src/org/lflang/generator/c/CGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CGenerator.java @@ -555,12 +555,6 @@ public void doGenerate(Resource resource, LFGeneratorContext context) { copyUserFiles(this.targetConfig, this.fileConfig); } - // 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(fileConfig.getSrcGenPath().toString(),File.separator, "BoardOptions.cmake")); - } - // Copy the core lib FileUtil.copyFilesFromClassPath( "/lib/c/reactor-c/core", @@ -573,6 +567,33 @@ public void doGenerate(Resource resource, LFGeneratorContext context) { ); // Copy the C target files copyTargetFiles(); + + // If we are running an Arduino Target, need to copy over the Arduino-CMake files. + if (targetConfig.platformOptions.platform == Platform.ARDUINO) { + FileUtil.copyDirectoryFromClassPath( + "/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino", + fileConfig.getSrcGenPath().resolve("toolchain/Arduino"), + false + ); + FileUtil.copyDirectoryFromClassPath( + "/lib/platform/arduino/Arduino-CMake-Toolchain/Platform", + fileConfig.getSrcGenPath().resolve("toolchain/Platform"), + false + ); + FileUtil.copyFileFromClassPath( + "/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino-toolchain.cmake", + fileConfig.getSrcGenPath().resolve("toolchain/Arduino-toolchain.cmake"), + true + ); + + StringBuilder s = new StringBuilder(); + s.append("set(ARDUINO_BOARD \""); + s.append(targetConfig.platformOptions.board.getBoardName()); + s.append("\")"); + FileUtil.writeToFile(s.toString(), + fileConfig.getSrcGenPath().resolve("toolchain/BoardOptions.cmake")); + } + // Write the generated code code.writeToFile(targetFile); } catch (IOException e) { @@ -1098,8 +1119,8 @@ private void generateReactorChildren( private void pickCompilePlatform() { var osName = System.getProperty("os.name").toLowerCase(); // if platform target was set, use given platform instead - if (targetConfig.platform != Platform.AUTO) { - osName = targetConfig.platform.toString(); + if (targetConfig.platformOptions.platform != Platform.AUTO) { + osName = targetConfig.platformOptions.platform.toString(); } if (osName.contains("arduino")) { return; @@ -2262,7 +2283,7 @@ protected void setUpGeneralParameters() { // So that each separate compile knows about modal reactors, do this: targetConfig.compileDefinitions.put("MODAL_REACTORS", ""); } - if (targetConfig.threading && targetConfig.platform == Platform.ARDUINO) { + if (targetConfig.threading && targetConfig.platformOptions.platform == Platform.ARDUINO) { //Add error message when user attempts to set threading=true for Arduino if (targetConfig.setByUser.contains(TargetProperty.THREADING)) { diff --git a/org.lflang/src/org/lflang/generator/c/CMainGenerator.java b/org.lflang/src/org/lflang/generator/c/CMainGenerator.java index d816a94668..8b302622b1 100644 --- a/org.lflang/src/org/lflang/generator/c/CMainGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CMainGenerator.java @@ -37,7 +37,7 @@ public String generateCode() { * Generate the `main` function. */ private String generateMainFunction() { - if (targetConfig.platform == Platform.ARDUINO) { + if (targetConfig.platformOptions.platform == Platform.ARDUINO) { /** By default, we must have a serial begin line prior to calling lf_reactor_c_main due to internal debugging messages requiring a print buffer. For the future, we can check whether internal LF logging is enabled or not before removing this line. @@ -46,7 +46,7 @@ private String generateMainFunction() { return String.join("\n", "// Arduino setup() and loop() functions", "void setup() {", - "Serial.begin(" + targetConfig.baudRate + ");", + "Serial.begin(" + targetConfig.platformOptions.baudRate + ");", "lf_reactor_c_main(0, NULL);", "}", "void loop() {}" diff --git a/org.lflang/src/org/lflang/generator/c/CPreambleGenerator.java b/org.lflang/src/org/lflang/generator/c/CPreambleGenerator.java index 534ec4fd71..4927d8d40a 100644 --- a/org.lflang/src/org/lflang/generator/c/CPreambleGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CPreambleGenerator.java @@ -37,7 +37,7 @@ public static String generateIncludeStatements( ) { var tracing = targetConfig.tracing; CodeBuilder code = new CodeBuilder(); - if(targetConfig.platform == Platform.ARDUINO) { + if (targetConfig.platformOptions.platform == Platform.ARDUINO) { CCoreFilesUtils.getArduinoTargetHeaders().forEach( it -> code.pr("#include " + StringUtil.addDoubleQuotes(it)) ); @@ -78,7 +78,7 @@ public static String generateDefineDirectives( code.pr("#define LOG_LEVEL " + logLevel); code.pr("#define TARGET_FILES_DIRECTORY " + addDoubleQuotes(srcGenPath.toString())); - if (targetConfig.platform == Platform.ARDUINO) { + if (targetConfig.platformOptions.platform == Platform.ARDUINO) { code.pr("#define MICROSECOND_TIME"); code.pr("#define BIT_32"); } diff --git a/test/C/src/arduino/BlinkCustomBaudRate.lf b/test/C/src/arduino/BlinkCustomPlatform.lf similarity index 67% rename from test/C/src/arduino/BlinkCustomBaudRate.lf rename to test/C/src/arduino/BlinkCustomPlatform.lf index 567fa645e9..609d4034b6 100644 --- a/test/C/src/arduino/BlinkCustomBaudRate.lf +++ b/test/C/src/arduino/BlinkCustomPlatform.lf @@ -2,13 +2,18 @@ * This example demonstrates a very simple blink program that will turn on and * off an LED on the Arduino Board with a 50% duty cycle switching every * half-second. + * + * This tests the overloading capabilities of the platform argument. */ target CCpp { - platform: "Arduino", - baud-rate: 112500 + platform: { + name: "arduino", + baud-rate: 9600, + board: "mega_2560" + } } -main reactor BlinkCustomBaudRate { +main reactor BlinkCustomPlatform { timer t1(0, 1 sec) timer t2(500 msec, 1 sec) diff --git a/test/C/src/arduino/BoardOptions.cmake b/test/C/src/arduino/BoardOptions.cmake deleted file mode 100644 index 80be666da1..0000000000 --- a/test/C/src/arduino/BoardOptions.cmake +++ /dev/null @@ -1,245 +0,0 @@ -# Copyright (c) 2020 Arduino CMake Toolchain - -############################################################################### -# This is an automatically generated template file for board options. -# You may edit it to comment/uncomment selected board and board options. -# However do not change the structure of this template, which is fixed and -# any change to the structure gets overwritten. - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# Arduino boards. -# Platform: Arduino AVR Boards -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# set(ARDUINO_BOARD "Arduino Yn [avr.yun]") # Arduino Yn -set(ARDUINO_BOARD "Arduino Uno [avr.uno]") # Arduino Uno -# set(ARDUINO_BOARD "Arduino Duemilanove or Diecimila [avr.diecimila]") # Arduino Duemilanove or Diecimila -# set(ARDUINO_BOARD "Arduino Nano [avr.nano]") # Arduino Nano -# set(ARDUINO_BOARD "Arduino Mega or Mega 2560 [avr.mega]") # Arduino Mega or Mega 2560 -# set(ARDUINO_BOARD "Arduino Mega ADK [avr.megaADK]") # Arduino Mega ADK -# set(ARDUINO_BOARD "Arduino Leonardo [avr.leonardo]") # Arduino Leonardo -# set(ARDUINO_BOARD "Arduino Leonardo ETH [avr.leonardoeth]") # Arduino Leonardo ETH -# set(ARDUINO_BOARD "Arduino Micro [avr.micro]") # Arduino Micro -# set(ARDUINO_BOARD "Arduino Esplora [avr.esplora]") # Arduino Esplora -# set(ARDUINO_BOARD "Arduino Mini [avr.mini]") # Arduino Mini -# set(ARDUINO_BOARD "Arduino Ethernet [avr.ethernet]") # Arduino Ethernet -# set(ARDUINO_BOARD "Arduino Fio [avr.fio]") # Arduino Fio -# set(ARDUINO_BOARD "Arduino BT [avr.bt]") # Arduino BT -# set(ARDUINO_BOARD "LilyPad Arduino USB [avr.LilyPadUSB]") # LilyPad Arduino USB -# set(ARDUINO_BOARD "LilyPad Arduino [avr.lilypad]") # LilyPad Arduino -# set(ARDUINO_BOARD "Arduino Pro or Pro Mini [avr.pro]") # Arduino Pro or Pro Mini -# set(ARDUINO_BOARD "Arduino NG or older [avr.atmegang]") # Arduino NG or older -# set(ARDUINO_BOARD "Arduino Robot Control [avr.robotControl]") # Arduino Robot Control -# set(ARDUINO_BOARD "Arduino Robot Motor [avr.robotMotor]") # Arduino Robot Motor -# set(ARDUINO_BOARD "Arduino Gemma [avr.gemma]") # Arduino Gemma -# set(ARDUINO_BOARD "Adafruit Circuit Playground [avr.circuitplay32u4cat]") # Adafruit Circuit Playground -# set(ARDUINO_BOARD "Arduino Yn Mini [avr.yunmini]") # Arduino Yn Mini -# set(ARDUINO_BOARD "Arduino Industrial 101 [avr.chiwawa]") # Arduino Industrial 101 -# set(ARDUINO_BOARD "Linino One [avr.one]") # Linino One -# set(ARDUINO_BOARD "Arduino Uno WiFi [avr.unowifi]") # Arduino Uno WiFi - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# Arduino boards. -# Platform: Arduino SAM Boards (32-bits ARM Cortex-M3) -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# set(ARDUINO_BOARD "Arduino Due (Programming Port) [sam.arduino_due_x_dbg]") # Arduino Due (Programming Port) -# set(ARDUINO_BOARD "Arduino Due (Native USB Port) [sam.arduino_due_x]") # Arduino Due (Native USB Port) - -#============================================================================== -# Menu options. -# Board: Arduino Yn [avr.yun] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Uno [avr.uno] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Duemilanove or Diecimila [avr.diecimila] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_DIECIMILA_MENU_CPU_ATMEGA328 TRUE) # ATmega328P -# set(ARDUINO_AVR_DIECIMILA_MENU_CPU_ATMEGA168 TRUE) # ATmega168 - -#============================================================================== -# Menu options. -# Board: Arduino Nano [avr.nano] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_NANO_MENU_CPU_ATMEGA328 TRUE) # ATmega328P -# set(ARDUINO_AVR_NANO_MENU_CPU_ATMEGA328OLD TRUE) # ATmega328P (Old Bootloader) -# set(ARDUINO_AVR_NANO_MENU_CPU_ATMEGA168 TRUE) # ATmega168 - -#============================================================================== -# Menu options. -# Board: Arduino Mega or Mega 2560 [avr.mega] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_MEGA_MENU_CPU_ATMEGA2560 TRUE) # ATmega2560 (Mega 2560) -# set(ARDUINO_AVR_MEGA_MENU_CPU_ATMEGA1280 TRUE) # ATmega1280 - -#============================================================================== -# Menu options. -# Board: Arduino Mega ADK [avr.megaADK] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Leonardo [avr.leonardo] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Leonardo ETH [avr.leonardoeth] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Micro [avr.micro] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Esplora [avr.esplora] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Mini [avr.mini] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_MINI_MENU_CPU_ATMEGA328 TRUE) # ATmega328P -# set(ARDUINO_AVR_MINI_MENU_CPU_ATMEGA168 TRUE) # ATmega168 - -#============================================================================== -# Menu options. -# Board: Arduino Ethernet [avr.ethernet] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Fio [avr.fio] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino BT [avr.bt] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_BT_MENU_CPU_ATMEGA328 TRUE) # ATmega328P -# set(ARDUINO_AVR_BT_MENU_CPU_ATMEGA168 TRUE) # ATmega168 - -#============================================================================== -# Menu options. -# Board: LilyPad Arduino USB [avr.LilyPadUSB] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: LilyPad Arduino [avr.lilypad] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_LILYPAD_MENU_CPU_ATMEGA328 TRUE) # ATmega328P -# set(ARDUINO_AVR_LILYPAD_MENU_CPU_ATMEGA168 TRUE) # ATmega168 - -#============================================================================== -# Menu options. -# Board: Arduino Pro or Pro Mini [avr.pro] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_PRO_MENU_CPU_16MHZATMEGA328 TRUE) # ATmega328P (5V, 16 MHz) -# set(ARDUINO_AVR_PRO_MENU_CPU_8MHZATMEGA328 TRUE) # ATmega328P (3.3V, 8 MHz) -# set(ARDUINO_AVR_PRO_MENU_CPU_16MHZATMEGA168 TRUE) # ATmega168 (5V, 16 MHz) -# set(ARDUINO_AVR_PRO_MENU_CPU_8MHZATMEGA168 TRUE) # ATmega168 (3.3V, 8 MHz) - -#============================================================================== -# Menu options. -# Board: Arduino NG or older [avr.atmegang] -#============================================================================== - -# Option: Processor -set(ARDUINO_AVR_ATMEGANG_MENU_CPU_ATMEGA168 TRUE) # ATmega168 -# set(ARDUINO_AVR_ATMEGANG_MENU_CPU_ATMEGA8 TRUE) # ATmega8 - -#============================================================================== -# Menu options. -# Board: Arduino Robot Control [avr.robotControl] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Robot Motor [avr.robotMotor] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Gemma [avr.gemma] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Adafruit Circuit Playground [avr.circuitplay32u4cat] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Yn Mini [avr.yunmini] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Industrial 101 [avr.chiwawa] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Linino One [avr.one] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Uno WiFi [avr.unowifi] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Due (Programming Port) [sam.arduino_due_x_dbg] -#============================================================================== - -#============================================================================== -# Menu options. -# Board: Arduino Due (Native USB Port) [sam.arduino_due_x] -#============================================================================== - -#****************************************************************************** -# Arduino programmers. -# Platform: Arduino AVR Boards -#****************************************************************************** -# set(ARDUINO_PROGRAMMER "AVR ISP [avr.avrisp]") # AVR ISP -# set(ARDUINO_PROGRAMMER "AVRISP mkII [avr.avrispmkii]") # AVRISP mkII -# set(ARDUINO_PROGRAMMER "USBtinyISP [avr.usbtinyisp]") # USBtinyISP -# set(ARDUINO_PROGRAMMER "ArduinoISP [avr.arduinoisp]") # ArduinoISP -# set(ARDUINO_PROGRAMMER "ArduinoISP.org [avr.arduinoisporg]") # ArduinoISP.org -# set(ARDUINO_PROGRAMMER "USBasp [avr.usbasp]") # USBasp -# set(ARDUINO_PROGRAMMER "Parallel Programmer [avr.parallel]") # Parallel Programmer -# set(ARDUINO_PROGRAMMER "Arduino as ISP [avr.arduinoasisp]") # Arduino as ISP -# set(ARDUINO_PROGRAMMER "Arduino as ISP (ATmega32U4) [avr.arduinoasispatmega32u4]") # Arduino as ISP (ATmega32U4) -# set(ARDUINO_PROGRAMMER "Arduino Gemma [avr.usbGemma]") # Arduino Gemma -# set(ARDUINO_PROGRAMMER "BusPirate as ISP [avr.buspirate]") # BusPirate as ISP -# set(ARDUINO_PROGRAMMER "Atmel STK500 development board [avr.stk500]") # Atmel STK500 development board -# set(ARDUINO_PROGRAMMER "Atmel JTAGICE3 (ISP mode) [avr.jtag3isp]") # Atmel JTAGICE3 (ISP mode) -# set(ARDUINO_PROGRAMMER "Atmel JTAGICE3 (JTAG mode) [avr.jtag3]") # Atmel JTAGICE3 (JTAG mode) -# set(ARDUINO_PROGRAMMER "Atmel-ICE (AVR) [avr.atmel_ice]") # Atmel-ICE (AVR) - -#****************************************************************************** -# Arduino programmers. -# Platform: Arduino SAM Boards (32-bits ARM Cortex-M3) -#******************************************************************************