-
Notifications
You must be signed in to change notification settings - Fork 64
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 CLI #1532
Support for Arduino CLI #1532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @arengarajan99! I've left some minor comments.
Co-authored-by: Marten Lohstroh <[email protected]>
Exception is CMakeLists.txt, which itself should not be in the map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready to me, modulo the remaining util.c
issue. Will approve and merge once fixed.
Oh, there are also a bunch of conflicts with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting close! Minor changes requested.
This reverts commit 57bed1d.
Follows template of Zephyr
Co-authored-by: Marten Lohstroh <[email protected]>
…increase efficiency of all tests.
@@ -47,11 +48,14 @@ | |||
import org.lflang.generator.LFGeneratorContext; | |||
import org.lflang.generator.LFGeneratorContext.BuildParm; | |||
import org.lflang.generator.MainContext; | |||
import org.lflang.generator.GeneratorCommandFactory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import?
import org.lflang.tests.Configurators.Configurator; | ||
import org.lflang.tests.LFTest.Result; | ||
import org.lflang.tests.TestRegistry.TestCategory; | ||
import org.lflang.util.FileUtil; | ||
import org.lflang.util.LFCommand; | ||
import org.lflang.util.ArduinoUtil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import?
With the new Arduino 2.0 IDE release, the functionality that allowed us to use CMake (the avr compiler) has been abstracted away, prompting us to move to Arduino-CLI, the backbone of the Arduino build system. Arduino-CLI has limitation with regards to how to compile multilayered projects, but allows for lazy compilation in a specified src folder.
This PR uses Arduino specifications in the following workflow: LFC generated code is treated like an Arduino Sketch and the corresponding reactor-c files are placed in a src folder to be lazy compiled. To do this, I removed files that aren't used by Arduino that when compiled will cause redefinition errors and changed all includes using Regex to be relative links inside the src folder since Arduino doesn't support adding additional include paths.
To try this:
arduino-cli board list
and record the Fully Qualified Board Name (FQBN) and portplatform: {name: arduino, board: <FQBN>}
target propertyarduino-cli upload -b <FQBN> -p <port>
Features implemented:
arduino
as the platform without specifying aboard
orport
will only generate C code (as it works now), but print a message instructing the user how to obtain the information and provide it to LFboard
andport
,arduino-cli
is invoked automatically (unless theno-compile
flag is used)