Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duktape added, peripheral modules corrected
- Loading branch information
1 parent
f470c18
commit 5ecf50d
Showing
10 changed files
with
91,861 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
node_modules | ||
node_modules |
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 @@ | ||
const uart = require('../peripheral/uart'); | ||
const SysTick = require('../peripheral/systick'); | ||
|
||
var FT232 = new uart(2, 115200, {split: '\n'}); | ||
|
||
FT232.on('data', (data) => { | ||
print(data); | ||
FT232.send(432); | ||
}); | ||
|
||
() => { | ||
print('hello'); | ||
FT232.send([0x61, 0x62, 0x63, 0x64, 0x65, 0x31]); | ||
FT232.send(['a', 'b', 'c', 'd', 'e', '2']); | ||
FT232.send('abcde3'); | ||
} |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
const events = require('events'); | ||
|
||
SysTick = function(milliseconds) { | ||
var systick = function(milliseconds) { | ||
events.EventEmitter.call(this); | ||
__C_SysTick_init(milliseconds); | ||
return new events.EventEmitter(); | ||
}; | ||
|
||
SysTick_irq = function() { | ||
SysTick.emit('tick'); | ||
}; | ||
systick.prototype = Object.create(events.EventEmitter.prototype); | ||
|
||
var systick_irq = function() { | ||
systick.emit('tick'); | ||
}; | ||
|
||
module.exports = systick; |
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
Oops, something went wrong.