add LoRa Blocks
This commit is contained in:
@@ -109,6 +109,9 @@ Blockly['Arduino'].init = function (workspace) {
|
||||
// creates a list of code for the loop to be runned once
|
||||
Blockly['Arduino'].loopCodeOnce_ = Object.create(null)
|
||||
|
||||
// creates a list of code for the loop to be runned once
|
||||
Blockly['Arduino'].codeFunctions_ = Object.create(null)
|
||||
|
||||
// creates a list of code variables
|
||||
Blockly['Arduino'].variables_ = Object.create(null)
|
||||
|
||||
@@ -192,7 +195,8 @@ Blockly['Arduino'].init = function (workspace) {
|
||||
*/
|
||||
Blockly['Arduino'].finish = function (code) {
|
||||
let libraryCode = '';
|
||||
let variablesCode = ''
|
||||
let variablesCode = '';
|
||||
let codeFunctions = '';
|
||||
let functionsCode = '';
|
||||
let definitionsCode = '';
|
||||
let loopCodeOnce = '';
|
||||
@@ -216,6 +220,10 @@ Blockly['Arduino'].finish = function (code) {
|
||||
loopCodeOnce += Blockly['Arduino'].loopCodeOnce_[key] + '\n';
|
||||
}
|
||||
|
||||
for (const key in Blockly['Arduino'].codeFunctions_) {
|
||||
codeFunctions += Blockly['Arduino'].codeFunctions_[key] + '\n';
|
||||
}
|
||||
|
||||
for (const key in Blockly['Arduino'].functionNames_) {
|
||||
functionsCode += Blockly['Arduino'].functionNames_[key] + '\n';
|
||||
}
|
||||
@@ -240,6 +248,8 @@ Blockly['Arduino'].finish = function (code) {
|
||||
'\n' +
|
||||
definitionsCode +
|
||||
'\n' +
|
||||
codeFunctions +
|
||||
'\n' +
|
||||
Blockly['Arduino'].variablesInitCode_ +
|
||||
'\n' +
|
||||
functionsCode +
|
||||
|
||||
Reference in New Issue
Block a user