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

Support for Arduino platforms #1272

merged 71 commits into from
Aug 31, 2022

Conversation

arengarajan99
Copy link
Contributor

@arengarajan99 arengarajan99 commented Jul 3, 2022

This program adds configurations for 32 bit and Microsecond Support for Arduino Only (can be extended universally by defining target configuration). Requires a little under 60kB worth of flash storage at the moment (Will not work for Nano and Uno boards as presently constructed). Blink program works out of the box.

Generating code for: file:/Users/arengarajan/Documents/GitHub/LinguaFranca/lingua-franca/test/C/src/arduino/Blink.lf
******** mode: STANDALONE
******** generated sources: /Users/arengarajan/Documents/GitHub/LinguaFranca/lingua-franca/test/C/src-gen/arduino/Blink
******** Using 1 threads to compile the program.
Code generation finished.
➜  lingua-franca git:(arduino-support) ✗ arduino-cli compile --fqbn arduino:sam:arduino_due_x test/C/src-gen/arduino/Blink
Sketch uses 54364 bytes (10%) of program storage space. Maximum is 524288 bytes.


Used platform Version Path                                                                     
arduino:sam   1.6.12  /Users/arengarajan/Library/Arduino15/packages/arduino/hardware/sam/1.6.12

➜  lingua-franca git:(arduino-support) ✗ arduino-cli upload --fqbn arduino:sam:arduino_due_x -p /dev/cu.usbmodem1401 test/C/src-gen/arduino/Blink
Atmel SMART device 0x285e0a60 found
Erase flash
done in 0.033 seconds

Write 56796 bytes to flash (222 pages)
[==============================] 100% (222/222 pages)
done in 10.935 seconds
Set boot flash true
CPU reset.

@lhstrh
Copy link
Member

lhstrh commented Jul 4, 2022

Did you mean to include changes to the reactor-cpp submodule as part of this PR?

lhstrh
lhstrh previously requested changes Jul 5, 2022
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Provided some feedback.

org.lflang/src/org/lflang/TargetConfig.java Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/generator/c/CCompiler.java Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/generator/c/CCoreFilesUtils.java Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/generator/c/CGenerator.java Outdated Show resolved Hide resolved
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs a bit more fine tuning. Also, you've accidentally updated the reactor-ts submodule as part of this PR.

test/C/src/arduino/AnalogReadSerial.lf Show resolved Hide resolved
test/C/src/arduino/BlinkAttemptThreading.lf Show resolved Hide resolved
test/C/src/arduino/BoardOptions.cmake Show resolved Hide resolved
test/C/src/arduino/BoardOptions.cmake Show resolved Hide resolved
test/C/src/arduino/DigitalReadSerial.lf Show resolved Hide resolved
test/C/src/arduino/Fade.lf Show resolved Hide resolved
test/C/src/arduino/ReadAnalogVoltage.lf Show resolved Hide resolved
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to hit the Finish your review button a while ago. Apologies! Here is some dangling feedback.

test/C/src/arduino/Fade.lf Outdated Show resolved Hide resolved
test/C/src/arduino/ReadAnalogVoltage.lf Outdated Show resolved Hide resolved
test/C/src/arduino/DigitalReadSerial.lf Outdated Show resolved Hide resolved
test/C/src/arduino/BlinkAttemptThreading.lf Outdated Show resolved Hide resolved
test/C/src/arduino/Blink.lf Outdated Show resolved Hide resolved
test/C/src/arduino/AnalogReadSerial.lf Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/generator/c/CGenerator.java Outdated Show resolved Hide resolved
@lhstrh lhstrh merged commit ce56dc6 into master Aug 31, 2022
@lhstrh lhstrh added the feature New feature label Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants