-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP compile a native led without phy on wasm
- Loading branch information
1 parent
38605d5
commit d956ba9
Showing
3 changed files
with
61 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#include "luos_engine.h" | ||
#include "ws_network.h" | ||
// #include "ws_network.h" | ||
#include "led.h" | ||
|
||
int main(void) | ||
{ | ||
Luos_Init(); | ||
Ws_Init(); | ||
// Ws_Init(); | ||
Led_Init(); | ||
while (1) | ||
{ | ||
Luos_Loop(); | ||
Ws_Loop(); | ||
// Ws_Loop(); | ||
Led_Loop(); | ||
} | ||
} |
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,42 @@ | ||
import os | ||
Import("env") | ||
|
||
# Create a symlink to clang++ in gcc | ||
try: | ||
os.symlink('/Applications/cheerp/bin/clang++', '/Applications/cheerp/bin/gcc') | ||
except FileExistsError: | ||
pass | ||
|
||
try: | ||
os.symlink('/Applications/cheerp/bin/llvm-link', '/Applications/cheerp/bin/ar') | ||
except FileExistsError: | ||
pass | ||
|
||
# Add the cheerp path at the beginning of the PATH environment variable | ||
new_gcc_path = '/Applications/cheerp/bin' | ||
current_path = os.environ.get('PATH', '') | ||
os.environ['PATH'] = f"{new_gcc_path}{os.pathsep}{current_path}" | ||
|
||
# Print the path used when calling gcc | ||
print("GCC used by platformio is :" + os.popen("which gcc").read()) | ||
|
||
# Add the cheerp-wasm target to the linker flags | ||
env.Append( | ||
LINKFLAGS=[ | ||
"--target=cheerp-wasm" | ||
] | ||
) | ||
|
||
# Add the cheerp-wasm target to the compiler flags | ||
env.Append( | ||
CCFLAGS=[ | ||
"--target=cheerp-wasm" | ||
] | ||
) | ||
|
||
# Replace the ar and ranlib commands with the appropriate llvm-ar command | ||
env.Replace(AR="/Applications/cheerp/bin/llvm-ar", | ||
RANLIB="/Applications/cheerp/bin/llvm-ar s", | ||
LD="/Applications/cheerp/bin/llvm-link", | ||
PROGNAME="program.bc") | ||
|