add LoRa Blocks

This commit is contained in:
Mario
2020-07-31 16:37:09 +02:00
parent 6678afbdff
commit dd874a2384
6 changed files with 717 additions and 1 deletions
+11 -1
View File
@@ -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 +