fix(boards): 修复arduino下 数组左/右循环 操作异常
This commit is contained in:
13
boards/default_src/arduino/webpack.common.js
Normal file
13
boards/default_src/arduino/webpack.common.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
const common = require('../../../webpack.common');
|
||||||
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
|
module.exports = merge(common, {
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(txt|c|cpp|h|hpp)$/,
|
||||||
|
type: 'asset/source'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("../../../webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
mode: 'development',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("../../../webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "production",
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
|||||||
@@ -721,10 +721,9 @@ export const loop_array = {
|
|||||||
init: function () {
|
init: function () {
|
||||||
this.appendValueInput("name")
|
this.appendValueInput("name")
|
||||||
.setCheck(null)
|
.setCheck(null)
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE)
|
|
||||||
.appendField(new Blockly.FieldDropdown(DATATYPES), "TYPE")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_LIST_NAME);
|
.appendField(Blockly.Msg.MIXLY_LIST_NAME);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
|
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||||
.appendField(new Blockly.FieldDropdown([
|
.appendField(new Blockly.FieldDropdown([
|
||||||
[Blockly.Msg.LEFT_CYCLE, "0"],
|
[Blockly.Msg.LEFT_CYCLE, "0"],
|
||||||
[Blockly.Msg.RIGHT_CYCLE, "1"]
|
[Blockly.Msg.RIGHT_CYCLE, "1"]
|
||||||
@@ -732,7 +731,7 @@ export const loop_array = {
|
|||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(LISTS_HUE);
|
this.setColour(LISTS_HUE);
|
||||||
this.setTooltip(Blockly.Msg.LEFT_CYCLE + Blockly.Msg.LEFT_CYCLE1 + Blockly.Msg.RIGHT_CYCLE + Blockly.Msg.RIGHT_CYCLE1);
|
this.setTooltip('');
|
||||||
this.setHelpUrl("");
|
this.setHelpUrl("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -259,19 +259,14 @@ export const lists_array2_setup_get_data = function (_, generator) {
|
|||||||
return code1;
|
return code1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import FUNC_ARRAY_ROTATE_LOOP_TEMPLATE from '../templates/func-array-rotate-loop.c';
|
||||||
|
|
||||||
// 一维数组循环
|
// 一维数组循环
|
||||||
export const loop_array = function (_, generator) {
|
export const loop_array = function (_, generator) {
|
||||||
var type = this.getFieldValue('TYPE');
|
|
||||||
var mode = this.getFieldValue('mode');
|
var mode = this.getFieldValue('mode');
|
||||||
var name = generator.valueToCode(this, 'name', generator.ORDER_ATOMIC);
|
var name = generator.valueToCode(this, 'name', generator.ORDER_ATOMIC);
|
||||||
if (mode == 0) {
|
generator.definitions_['function_array_rotate_loop'] = FUNC_ARRAY_ROTATE_LOOP_TEMPLATE;
|
||||||
generator.definitions_['loop_array1'] = 'void array_left_loop() {\n ' + type + ' item =0;\n item = ' + name + '[(int)(0)];\n for (int i = (2); i <= (sizeof(' + name + ')/sizeof(' + name + '[0])); i = i + (1)) {\n ' + name + '[(int)((i - 1) - 1)] = ' + name + '[(int)(i - 1)];\n }\n ' + name + '[(int)(sizeof(' + name + ')/sizeof(' + name + '[0]) - 1)] = item;\n}\n';
|
var code = `array_rotate_loop(${name}, sizeof(${name}[0]), sizeof(${name}) / sizeof(${name}[0]), ${mode});\n`;
|
||||||
var code = 'array_left_loop();\n';
|
|
||||||
}
|
|
||||||
if (mode == 1) {
|
|
||||||
generator.definitions_['loop_array'] = 'void array_right_loop() {\n ' + type + ' item =0;\n item = ' + name + '[(int)(sizeof(' + name + ')/sizeof(' + name + '[0]) - 1)];\n for (int i = (sizeof(' + name + ')/sizeof(' + name + '[0])); i >= (1); i = i + (-1)) {\n ' + name + '[(int)((i + 1) - 1)] = ' + name + '[(int)(i - 1)];\n }\n ' + name + '[(int)(0)] = item;\n}\n';
|
|
||||||
var code = 'array_right_loop();\n';
|
|
||||||
}
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -577,6 +577,13 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
|
<block type="loop_array">
|
||||||
|
<value name="name">
|
||||||
|
<shadow type="math_number">
|
||||||
|
<field name="NUM">mylist</field>
|
||||||
|
</shadow>
|
||||||
|
</value>
|
||||||
|
</block>
|
||||||
<block type="lists_array2_setup">
|
<block type="lists_array2_setup">
|
||||||
<field name="lists_create_type">int</field>
|
<field name="lists_create_type">int</field>
|
||||||
<field name="lists_create_name">mylist</field>
|
<field name="lists_create_name">mylist</field>
|
||||||
@@ -645,7 +652,7 @@
|
|||||||
<block type="create_array2_with_text">
|
<block type="create_array2_with_text">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -667,7 +674,7 @@
|
|||||||
<block type="lists2SetValueByIndex">
|
<block type="lists2SetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -689,7 +696,7 @@
|
|||||||
<block type="lists2GetValueByIndex">
|
<block type="lists2GetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -703,13 +710,6 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="loop_array">
|
|
||||||
<value name="name">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">array</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="lists_array2_get_length">
|
<block type="lists_array2_get_length">
|
||||||
</block>
|
</block>
|
||||||
</category>
|
</category>
|
||||||
@@ -2690,7 +2690,7 @@
|
|||||||
<block type="i2c_slave_write_array">
|
<block type="i2c_slave_write_array">
|
||||||
<value name="array">
|
<value name="array">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="length">
|
<value name="length">
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
void array_rotate_loop(void *arr, size_t elem_size, size_t length, bool right) {
|
||||||
|
if (length <= 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t buffer[32];
|
||||||
|
if (elem_size > sizeof(buffer)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (right) {
|
||||||
|
memcpy(buffer, (uint8_t *)arr + (length - 1) * elem_size, elem_size);
|
||||||
|
memmove((uint8_t *)arr + elem_size, arr, (length - 1) * elem_size);
|
||||||
|
memcpy(arr, buffer, elem_size);
|
||||||
|
} else {
|
||||||
|
memcpy(buffer, arr, elem_size);
|
||||||
|
memmove(arr, (uint8_t *)arr + elem_size, (length - 1) * elem_size);
|
||||||
|
memcpy((uint8_t *)arr + (length - 1) * elem_size, buffer, elem_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("../../../webpack.common");
|
const common = require('../../../webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@mixly/arduino': path.resolve(__dirname, '../arduino')
|
'@mixly/arduino': path.resolve(__dirname, '../arduino')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(txt|c|cpp|h|hpp)$/,
|
||||||
|
type: 'asset/source'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
mode: 'development',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "production",
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
|||||||
@@ -611,6 +611,13 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
|
<block type="loop_array">
|
||||||
|
<value name="name">
|
||||||
|
<shadow type="math_number">
|
||||||
|
<field name="NUM">mylist</field>
|
||||||
|
</shadow>
|
||||||
|
</value>
|
||||||
|
</block>
|
||||||
<block type="lists_array2_setup">
|
<block type="lists_array2_setup">
|
||||||
<field name="lists_create_type">int</field>
|
<field name="lists_create_type">int</field>
|
||||||
<field name="lists_create_name">mylist</field>
|
<field name="lists_create_name">mylist</field>
|
||||||
@@ -679,7 +686,7 @@
|
|||||||
<block type="create_array2_with_text">
|
<block type="create_array2_with_text">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -701,7 +708,7 @@
|
|||||||
<block type="lists2SetValueByIndex">
|
<block type="lists2SetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -723,7 +730,7 @@
|
|||||||
<block type="lists2GetValueByIndex">
|
<block type="lists2GetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -737,13 +744,6 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="loop_array">
|
|
||||||
<value name="name">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">array</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="lists_array2_get_length">
|
<block type="lists_array2_get_length">
|
||||||
</block>
|
</block>
|
||||||
</category>
|
</category>
|
||||||
@@ -2096,7 +2096,7 @@
|
|||||||
<block type="i2c_slave_write_array">
|
<block type="i2c_slave_write_array">
|
||||||
<value name="array">
|
<value name="array">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="length">
|
<value name="length">
|
||||||
|
|||||||
@@ -582,6 +582,13 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
|
<block type="loop_array">
|
||||||
|
<value name="name">
|
||||||
|
<shadow type="math_number">
|
||||||
|
<field name="NUM">mylist</field>
|
||||||
|
</shadow>
|
||||||
|
</value>
|
||||||
|
</block>
|
||||||
<block type="lists_array2_setup">
|
<block type="lists_array2_setup">
|
||||||
<field name="lists_create_type">int</field>
|
<field name="lists_create_type">int</field>
|
||||||
<field name="lists_create_name">mylist</field>
|
<field name="lists_create_name">mylist</field>
|
||||||
@@ -650,7 +657,7 @@
|
|||||||
<block type="create_array2_with_text">
|
<block type="create_array2_with_text">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -672,7 +679,7 @@
|
|||||||
<block type="array2_assignment">
|
<block type="array2_assignment">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -694,7 +701,7 @@
|
|||||||
<block type="get_array2_value">
|
<block type="get_array2_value">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -708,12 +715,7 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="loop_array">
|
<block type="lists_array2_get_length">
|
||||||
<value name="name">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">array</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
</block>
|
||||||
</category>
|
</category>
|
||||||
<category id="catVar" colour="330" custom="VARIABLE">
|
<category id="catVar" colour="330" custom="VARIABLE">
|
||||||
@@ -2204,7 +2206,7 @@
|
|||||||
<block type="i2c_slave_write_array">
|
<block type="i2c_slave_write_array">
|
||||||
<value name="array">
|
<value name="array">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="length">
|
<value name="length">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("../../../webpack.common");
|
const common = require('../../../webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
resolve: {
|
resolve: {
|
||||||
@@ -8,5 +8,13 @@ module.exports = merge(common, {
|
|||||||
'@mixly/arduino': path.resolve(__dirname, '../arduino'),
|
'@mixly/arduino': path.resolve(__dirname, '../arduino'),
|
||||||
'@mixly/arduino-avr': path.resolve(__dirname, '../arduino_avr')
|
'@mixly/arduino-avr': path.resolve(__dirname, '../arduino_avr')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(txt|c|cpp|h|hpp)$/,
|
||||||
|
type: 'asset/source'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
mode: 'development',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "production",
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
|||||||
@@ -536,6 +536,13 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
|
<block type="loop_array">
|
||||||
|
<value name="name">
|
||||||
|
<shadow type="math_number">
|
||||||
|
<field name="NUM">mylist</field>
|
||||||
|
</shadow>
|
||||||
|
</value>
|
||||||
|
</block>
|
||||||
<block type="lists_array2_setup">
|
<block type="lists_array2_setup">
|
||||||
<field name="lists_create_type">int</field>
|
<field name="lists_create_type">int</field>
|
||||||
<field name="lists_create_name">mylist</field>
|
<field name="lists_create_name">mylist</field>
|
||||||
@@ -604,7 +611,7 @@
|
|||||||
<block type="create_array2_with_text">
|
<block type="create_array2_with_text">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -626,7 +633,7 @@
|
|||||||
<block type="lists2SetValueByIndex">
|
<block type="lists2SetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -648,7 +655,7 @@
|
|||||||
<block type="lists2GetValueByIndex">
|
<block type="lists2GetValueByIndex">
|
||||||
<value name="name">
|
<value name="name">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">array</field>
|
<field name="NUM">mylist</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
<value name="line">
|
<value name="line">
|
||||||
@@ -662,13 +669,6 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="loop_array">
|
|
||||||
<value name="name">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">array</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="lists_array2_get_length">
|
<block type="lists_array2_get_length">
|
||||||
</block>
|
</block>
|
||||||
</category>
|
</category>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("../../../webpack.common");
|
const common = require('../../../webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
resolve: {
|
resolve: {
|
||||||
@@ -8,5 +8,13 @@ module.exports = merge(common, {
|
|||||||
'@mixly/arduino': path.resolve(__dirname, '../arduino'),
|
'@mixly/arduino': path.resolve(__dirname, '../arduino'),
|
||||||
'@mixly/arduino-avr': path.resolve(__dirname, '../arduino_avr')
|
'@mixly/arduino-avr': path.resolve(__dirname, '../arduino_avr')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(txt|c|cpp|h|hpp)$/,
|
||||||
|
type: 'asset/source'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
mode: 'development',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "production",
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
|||||||
Reference in New Issue
Block a user