-
Notifications
You must be signed in to change notification settings - Fork 75
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
Added JS C module Support MRAA Examples #49
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
514b9e2
Add C-module support from JS Examples
vaishnavachath 5b83a69
move C-ModulefromJS examples(mraa) to Folder: MRAA
vaishnavachath cc1486d
draft PocketBeagleUI Implementation
vaishnavachath 5c258e1
modify Makefile for ffi_examples compilation
vaishnavachath 36223e8
Update bonecard.css
vaishnavachath 6a9b492
change voltage range to 3.3v _draft
vaishnavachath baf1df3
change voltage level to 3.3
vaishnavachath 4a9841c
Revert "change voltage level to 3.3"
vaishnavachath bab3d6e
change voltage levels to 3.3v_draft
vaishnavachath 568a016
add warnings for pins
vaishnavachath 1df25ee
add warnings
vaishnavachath 6904981
add demo-pages for writeCModule and loadCModule
vaishnavachath 2692956
change callbacks to nodestyle
vaishnavachath eb4e07f
Update .travis.yml
vaishnavachath 3dd6f29
fix internal linking error
vaishnavachath 394ee1a
ignore Support/bone101/PBUI
vaishnavachath 85f0ddc
made changes suggested in review1
vaishnavachath 81be02b
add draft beaglebonbe-ui
vaishnavachath fe168cf
draft beaglebone-ui -beautify
vaishnavachath 3e747b9
add support for pocketbeagle
vaishnavachath 44fdcfa
rename pocketbeagle image
vaishnavachath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: ruby | ||
rvm: | ||
- 2.1 | ||
- 2.4.4 | ||
sudo: required | ||
services: | ||
- docker | ||
|
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
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
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,82 @@ | ||
--- | ||
layout: index | ||
title: loadCModule | ||
scripts: [ '/Support/script/bonescript-demo.js' ] | ||
style: | | ||
#code { | ||
position: relative; | ||
width: 500px; | ||
padding-left: 0; | ||
border-radius: 4px; | ||
border-bottom-right-radius: 0px; | ||
border-bottom-left-radius: 0px; | ||
margin-bottom: 0px; | ||
margin-left: 30px; | ||
margin-right: 0px; | ||
align: left; | ||
} | ||
#console-output { | ||
margin-top: 0px; | ||
margin-left: 30px; | ||
width: 496px; | ||
border: 1px solid #cccccc; | ||
resize: vertical; | ||
} | ||
--- | ||
{% include side_menu.html title="BoneScript" %} | ||
<div class="t3_content_1"> | ||
<div id='connect-status'></div> | ||
<div id="content_child"> | ||
|
||
<p>You might be able to see a newer version of this on <a href="http://beagleboard.org/support/bonescript/loadCModule">beagleboard.org/support/bonescript/writeCModule</a></p> | ||
<h1>loadCModule(filepath,fnNames&arguments, isMRAA)</h1> | ||
<p>Loads functions from the C program provided at the path with Function names and arguments in the fnName&arguments input.</p> | ||
<h2>Arguments</h2> | ||
<ul> | ||
<li><em>filename</em>: complete path of the C file</li> | ||
<li><em>fnNames&arguments </em>: (object)contains functions name and input/output arguments in the format: <br> | ||
{function_name : [ 'outArgType' , [ 'inArg1Type',inArg2Type',...]]}<br> | ||
function_name: (string) corresponds to the name of the function to be loaded.<br> | ||
outArgType: (string) corresponds to the output argument type of the function loaded.<br> | ||
inArgTypeZ: (string) corresponds to the input arguments type of the function loaded.<br> | ||
</li> | ||
<li><em>isMRAA</em>: (boolean)whether to link link mraa headers during compilation(default : false).</li> | ||
</ul> | ||
<h2>return</h2> | ||
<ul> | ||
<li><em>x</em>: (object)the function loaded corresponding to the input provided</li> | ||
</ul> | ||
<h2>Example | ||
<button class="dynlink" onclick="demoRun('code')">run</button> | ||
<button class="dynlink" onclick="demoRestore('code')">restore</button> | ||
</h2> | ||
<pre id="code" class="use-editor" style="height: 200px;"> | ||
var b = require('bonescript'); | ||
var args = { | ||
'main': ['int', ['int']] | ||
}; | ||
var x = b.loadCModule('/usr/share/bone101/examples/extras/helloworld', args,false); | ||
x.main(1, function (err, res) {}); //default sync usage | ||
//x.main.async(1, function (err, res) {}); //async usage | ||
</pre> | ||
<div readonly id='console-output' style='height: 80px;'></div> | ||
<h2>Build and execute instructions</h2> | ||
<ul> | ||
<li>Run the above to load a helloworld.c program at the path generated using <a href="{{site.baseurl}}/Support/BoneScript/writeCModule">writeCModule</a> </li> | ||
<li>Modify the Path and Args to load other modules.</li> | ||
</ul> | ||
<h2>See also</h2> | ||
<!-- | ||
<h3>Topics</h3> | ||
<ul> | ||
</ul> | ||
--> | ||
<h3>Related functions</h3> | ||
<ul> | ||
<li><a href="{{site.baseurl}}/Support/BoneScript/#require">require</a></li> | ||
<li><a href="{{site.baseurl}}/Support/BoneScript/writeCModule">writeCModule</a></li> | ||
</ul> | ||
|
||
|
||
</div> | ||
</div> |
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,80 @@ | ||
--- | ||
layout: index | ||
title: writeCModule | ||
scripts: [ '/Support/script/bonescript-demo.js' ] | ||
style: | | ||
#code { | ||
position: relative; | ||
width: 500px; | ||
padding-left: 0; | ||
border-radius: 4px; | ||
border-bottom-right-radius: 0px; | ||
border-bottom-left-radius: 0px; | ||
margin-bottom: 0px; | ||
margin-left: 30px; | ||
margin-right: 0px; | ||
align: left; | ||
} | ||
#console-output { | ||
margin-top: 0px; | ||
margin-left: 30px; | ||
width: 496px; | ||
border: 1px solid #cccccc; | ||
resize: vertical; | ||
} | ||
--- | ||
{% include side_menu.html title="BoneScript" %} | ||
<div class="t3_content_1"> | ||
<div id='connect-status'></div> | ||
<div id="content_child"> | ||
|
||
<p>You might be able to see a newer version of this on <a href="http://beagleboard.org/support/bonescript/writeCModule">beagleboard.org/support/bonescript/writeCModule</a></p> | ||
<h1>writeCModule(filename, code, [callback])</h1> | ||
<p>write a C program with Source code provided in the code input at the filename path.</p> | ||
<h2>Arguments</h2> | ||
<ul> | ||
<li><em>filename</em>: complete path of the file to be written</li> | ||
<li><em>code</em>: code string to be written</li> | ||
<li><em>callback</em>: called upon completion</li> | ||
</ul> | ||
<h2>callback(x)</h2> | ||
<ul> | ||
<li><em>x.err</em>: error status message</li> | ||
</ul> | ||
<h2>Example | ||
<button class="dynlink" onclick="demoRun('code')">run</button> | ||
<button class="dynlink" onclick="demoRestore('code')">restore</button> | ||
</h2> | ||
<pre id="code" class="use-editor" style="height: 200px;"> | ||
var b = require('bonescript'); | ||
var code = ` | ||
#include <stdio.h> | ||
int main(int argc) | ||
{ | ||
printf("Hello, World!"); | ||
return 0; | ||
}`; //code enclosed between `` | ||
b.writeCModule('/usr/share/bone101/examples/extras/helloworld', code); | ||
</pre> | ||
<div readonly id='console-output' style='height: 80px;'></div> | ||
<h2>Build and execute instructions</h2> | ||
<ul> | ||
<li>Be careful not to overwrite important files!</li> | ||
<li>Run the above to generate a helloworld.c file at the path and use <a href="{{site.baseurl}}/Support/BoneScript/loadCModule">loadCModule</a> to compile and run.</li> | ||
<li>Modify the C code.</li> | ||
</ul> | ||
<h2>See also</h2> | ||
<!-- | ||
<h3>Topics</h3> | ||
<ul> | ||
</ul> | ||
--> | ||
<h3>Related functions</h3> | ||
<ul> | ||
<li><a href="{{site.baseurl}}/Support/BoneScript/#require">require</a></li> | ||
<li><a href="{{site.baseurl}}/Support/BoneScript/loadCModule">loadCModule</a></li> | ||
</ul> | ||
|
||
|
||
</div> | ||
</div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I plan to reverse this and simply remove the reference to the missing file.