修改块
This commit is contained in:
@@ -133,6 +133,9 @@ export const timer = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated To be removed in the future
|
||||
*/
|
||||
export const system_timer = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
@@ -176,6 +179,9 @@ export const system_ticks_diff = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated To be removed in the future
|
||||
*/
|
||||
export const system_timer_init = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
@@ -190,6 +196,35 @@ export const system_timer_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const set_system_timer = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
this.appendValueInput('VAR')
|
||||
.appendField("Timer")
|
||||
.setCheck("var")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP);
|
||||
this.appendValueInput("PIN")
|
||||
.appendField("ID")
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("period")
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_mSecond)
|
||||
.appendField(Blockly.Msg.MIXLY_MODE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_PYTHON_ONE_SHOT, "ONE_SHOT"],
|
||||
[Blockly.Msg.MIXLY_PYTHON_PERIODIC, "PERIODIC"]
|
||||
]), "mode");
|
||||
this.appendValueInput('callback')
|
||||
.appendField(Blockly.Msg.MIXLY_DO)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_SYSTEM_TIMER_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const system_wdt_init = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
|
||||
Reference in New Issue
Block a user