Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
a87881a8
Commit
a87881a8
authored
Dec 29, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up temporary Arduino generator data.
parent
077e104d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
blockly/generators/arduino.js
blockly/generators/arduino.js
+13
-1
No files found.
blockly/generators/arduino.js
View file @
a87881a8
...
...
@@ -166,6 +166,16 @@ Blockly.Arduino.finish = function(code) {
setups
.
push
(
userSetupCode
);
}
// Clean up temporary data
delete
Blockly
.
Arduino
.
includes_
;
delete
Blockly
.
Arduino
.
definitions_
;
delete
Blockly
.
Arduino
.
codeFunctions_
;
delete
Blockly
.
Arduino
.
userFunctions_
;
delete
Blockly
.
Arduino
.
functionNames_
;
delete
Blockly
.
Arduino
.
setups_
;
delete
Blockly
.
Arduino
.
pins_
;
Blockly
.
Arduino
.
variableDB_
.
reset
();
var
allDefs
=
includes
.
join
(
'
\n
'
)
+
definitions
.
join
(
'
\n
'
)
+
functions
.
join
(
'
\n\n
'
);
var
setup
=
'
void setup() {
'
+
setups
.
join
(
'
\n
'
)
+
'
\n
}
\n\n
'
;
...
...
@@ -200,7 +210,7 @@ Blockly.Arduino.addDeclaration = function(declarationTag, code) {
/**
* Adds a string of code into the Arduino setup() function. It takes an
* identifier to not repeat the same kind of initialisation code from several
* blocks. If overwrite
func
tion is set to true it will overwrite whatever
* blocks. If overwrite
op
tion is set to true it will overwrite whatever
* value the identifier held before.
* @param {!string} setupTag Identifier for the type of set up code.
* @param {!string} code Code to be included in the setup() function.
...
...
@@ -353,7 +363,9 @@ Blockly.Arduino.getArduinoType_ = function(typeBlockly) {
case
Blockly
.
StaticTyping
.
BlocklyType
.
ERROR
:
return
'
ErrorArdu
'
;
case
Blockly
.
StaticTyping
.
BlocklyType
.
CHILD_BLOCK_MISSING
:
// If no block connected default to int, change for easier debugging
return
'
ChildBlockMissing
'
;
//return 'int';
default
:
return
'
Invalid Blockly Type
'
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment