Skip to content

Commit b802217

Browse files
committed
fixed max7219 animate stop
1 parent 6d15568 commit b802217

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

generators/webduino.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,7 @@ Blockly.JavaScript['max7219_animate'] = function (block) {
16561656
var varData = Blockly.JavaScript.variableDB_.getDistinctName(
16571657
'varData', Blockly.Variables.NAME_TYPE);
16581658
var code = 'var ' + varData + ' = ' + value_list_ + ';\n' +
1659+
variable_name_ + '.animateStop();\n'+
16591660
variable_name_ + '.animate(' + varData + ',' + value_times_ + ');\n';
16601661
return code;
16611662
};
@@ -1696,7 +1697,8 @@ Blockly.JavaScript['max7219_animate_horse'] = function (block) {
16961697
'}'
16971698
]);
16981699
//var code = 'console.log('+functionName+'('+dropdown_state_+','+value_code_ +'));\n';
1699-
var code = variable_name_ + '.animate(' + functionName + '(' + dropdown_state_ + ',' + value_code_ + '),' + value_times_ + ');\n';
1700+
var code = variable_name_ + '.animateStop();\n'+
1701+
variable_name_ + '.animate(' + functionName + '(' + dropdown_state_ + ',' + value_code_ + '),' + value_times_ + ');\n';
17001702
return code;
17011703

17021704
};
@@ -1711,7 +1713,8 @@ Blockly.JavaScript['max7219_stop'] = function (block) {
17111713

17121714
Blockly.JavaScript['max7219_off'] = function (block) {
17131715
var variable_name_ = Blockly.JavaScript.variableDB_.getName(block.getFieldValue('name_'), Blockly.Variables.NAME_TYPE);
1714-
var code = variable_name_ + '.off();\n';
1716+
var code = variable_name_ + '.animateStop();\n'+
1717+
variable_name_ + '.off();\n';
17151718
return code;
17161719
};
17171720

0 commit comments

Comments
 (0)