Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Closes #8] Add support for Spin2Cpp via function and add_custom_command
- Loading branch information
1 parent
6005fc7
commit 3370d5b
Showing
5 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
|
||
# Spin2Cpp is a PropWare 2.1 veature, so you must have at least PropWare 2.1 | ||
find_package(PropWare 2.1 REQUIRED) | ||
|
||
project(Spin2Cpp_Demo) | ||
|
||
# FullDuplexSerial.spin is just a library, so we only pass the name of the Spin file and a name for the output variable | ||
spin2cpp(FullDuplexSerial.spin FullDuplexSerial_CXX_FILES) | ||
|
||
# Hello.spin contains our "main" method, so we need to pass a third parameter which marks it as the main file | ||
spin2cpp(Hello.spin Hello_CXX_FILES 1) | ||
|
||
# Now we create an executable and include source files that match up to our spin files. | ||
create_simple_executable(Spin2Cpp_Demo ${Hello_CXX_FILES} ${FullDuplexSerial_CXX_FILES}) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CON | ||
_clkmode = xtal1 + pll16x | ||
_clkfreq = 80_000_000 | ||
|
||
OBJ | ||
fds : "FullDuplexSerial.spin" | ||
|
||
PUB demo | i | ||
|
||
'' start up the serial port | ||
fds.start(31, 30, 0, 115200) | ||
|
||
'' and say hello | ||
repeat 3 | ||
fds.str(string("Hello, world!", 13, 10)) | ||
|