Update(boards): micropython板卡下移除一些块的覆写
This commit is contained in:
@@ -46,22 +46,6 @@ export const inout_digital_read = {
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pwm_analog_write = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_VALUE2)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_write = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
@@ -100,22 +84,6 @@ export const inout_analog_write_set = {
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pwm_analog_write_set_freq = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_FREQUENCY + Blockly.Msg.MIXLY_STAT)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_read = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
@@ -223,40 +191,6 @@ export const inout_digital_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pwm_analog_write_init = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
// this.appendValueInput("PIN", Number)
|
||||
// .appendField(Blockly.Msg.MIXLY_SETUP)
|
||||
// .appendField("PWM"+Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
// .appendField('pwm')
|
||||
// .setCheck(Number);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
||||
.appendField(new Blockly.FieldTextInput('pwm#'), 'PIN_OBJ')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
||||
this.appendDummyInput("")
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
// .appendField('pwm')
|
||||
// .appendField(new Blockly.FieldDropdown(profile.default.pwm_pin),"PIN")
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_INIT_TOOLTIP);
|
||||
},
|
||||
getVars: function () {
|
||||
return [this.getFieldValue('PIN_OBJ') == 'pwm#' ? null : this.getFieldValue('PIN_OBJ')];
|
||||
},
|
||||
renameVar: function (oldName, newName) {
|
||||
if (Blockly.Names.equals(oldName, this.getFieldValue('PIN_OBJ'))) {
|
||||
this.setTitleValue(newName, 'PIN_OBJ');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_write_init = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
@@ -359,8 +293,23 @@ export const inout_pin_pressed_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_write_set_freq = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_FREQUENCY + Blockly.Msg.MIXLY_STAT)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pinMode = inout_digital_init;
|
||||
export const inout_analog_write_set_freq = inout_pwm_analog_write_set_freq;
|
||||
export const pin_pressed_init = inout_pin_pressed_init;
|
||||
export const pin_pressed = inout_pin_pressed;
|
||||
export const controls_pin_attachInterrupt = inout_pin_attachInterrupt;
|
||||
|
||||
Reference in New Issue
Block a user