File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ var factoryFlashMemory;
13
13
// Log of messages from app
14
14
var appLog = "" ;
15
15
var lastOutputLine = "" ;
16
+ var consoleOutputCallback ;
16
17
17
18
function onConsoleOutput ( txt ) {
18
19
appLog += txt + "\n" ;
19
20
lastOutputLine = txt ;
21
+ if ( consoleOutputCallback )
22
+ consoleOutputCallback ( txt ) ;
23
+ else
24
+ console . log ( "EMSCRIPTEN:" , txt ) ;
20
25
}
21
26
22
27
exports . init = function ( options ) {
@@ -29,8 +34,10 @@ exports.init = function(options) {
29
34
eval ( require ( "fs" ) . readFileSync ( DIR_IDE + "/emu/emu_" + EMULATOR + ".js" ) . toString ( ) ) ;
30
35
eval ( require ( "fs" ) . readFileSync ( DIR_IDE + "/emu/common.js" ) . toString ( ) /*.replace('console.log("EMSCRIPTEN:"', '//console.log("EMSCRIPTEN:"')*/ ) ;
31
36
32
- jsRXCallback = function ( ) { } ;
37
+ jsRXCallback = options . rxCallback ? options . rxCallback : function ( ) { } ;
33
38
jsUpdateGfx = function ( ) { } ;
39
+ if ( options . consoleOutputCallback )
40
+ consoleOutputCallback = options . consoleOutputCallback ;
34
41
35
42
factoryFlashMemory = new Uint8Array ( FLASH_SIZE ) ;
36
43
factoryFlashMemory . fill ( 255 ) ;
You can’t perform that action at this time.
0 commit comments