diff --git a/boards/default/micropython_esp32s2/config.json b/boards/default/micropython_esp32s2/config.json index a4853615..72d623e9 100644 --- a/boards/default/micropython_esp32s2/config.json +++ b/boards/default/micropython_esp32s2/config.json @@ -8,17 +8,31 @@ "type": "command", "portSelect": "all", "micropython:esp32s2:mixgo_ce": { - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"" + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"", + "special": [ + { + "name": "Default", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"" + }, + { + "name": "ESP-AT-mode", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" + } + ] }, "micropython:esp32s2:generic": { - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"" - }, - "special": [ - { - "name": "ESP-AT-mode", - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" - } - ] + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"", + "special": [ + { + "name": "Default", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"" + }, + { + "name": "ESP-AT-mode", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" + } + ] + } }, "upload": { "type": "command", diff --git a/boards/default_src/micropython_esp32s2/origin/config.json b/boards/default_src/micropython_esp32s2/origin/config.json index a4853615..72d623e9 100644 --- a/boards/default_src/micropython_esp32s2/origin/config.json +++ b/boards/default_src/micropython_esp32s2/origin/config.json @@ -8,17 +8,31 @@ "type": "command", "portSelect": "all", "micropython:esp32s2:mixgo_ce": { - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"" + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"", + "special": [ + { + "name": "Default", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/MixGo_CE-0x1000-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"" + }, + { + "name": "ESP-AT-mode", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" + } + ] }, "micropython:esp32s2:generic": { - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"" - }, - "special": [ - { - "name": "ESP-AT-mode", - "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" - } - ] + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"", + "special": [ + { + "name": "Default", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_0x1000-V1.19.1.bin\"" + }, + { + "name": "ESP-AT-mode", + "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\"" + } + ] + } }, "upload": { "type": "command", diff --git a/boards/default_src/python/python_generator.js b/boards/default_src/python/python_generator.js index 808c82bb..cda4d1fa 100644 --- a/boards/default_src/python/python_generator.js +++ b/boards/default_src/python/python_generator.js @@ -139,7 +139,6 @@ Python.init = function () { } } - Python.finish = function (code) { // Convert the definitions dictionary into a list. if (code !== "") { @@ -177,7 +176,7 @@ Python.finish = function (code) { if (loops.length > 0) return definitions.join('\n') + '\n' + functions.join('\n') + '\n' + setups.join('') + '\n' + code + 'while True:\n' + loops.join('') + codeEnd.join('\n'); return definitions.join('\n') + '\n' + functions.join('\n') + '\n' + setups.join('') + '\n' + code + codeEnd.join('\n'); -}; +} /** @@ -188,7 +187,7 @@ Python.finish = function (code) { */ Python.scrubNakedValue = function (line) { return line + '\n'; -}; +} /** * Encode a string as a properly escaped Python string, complete with quotes. @@ -211,7 +210,7 @@ Python.quote_ = function (string) { } } return quote + string + quote; -}; +} /** * Encode a string as a properly escaped multiline Python string, complete @@ -224,7 +223,7 @@ Python.multiline_quote_ = function (string) { // Can't use goog.string.quote since % must also be escaped. string = string.replace(/'''/g, '\\\'\\\'\\\''); return '\'\'\'' + string + '\'\'\''; -}; +} /** * Common tasks for generating Python from blocks. @@ -264,7 +263,7 @@ Python.scrub_ = function (block, code, opt_thisOnly) { var nextBlock = block.nextConnection && block.nextConnection.targetBlock(); var nextCode = opt_thisOnly ? '' : Python.blockToCode(nextBlock); return commentCode + code + nextCode; -}; +} /** * Gets a property and adjusts the value, taking into account indexing, and @@ -305,4 +304,4 @@ Python.getAdjustedInt = function (block, atId, opt_delta, opt_negate) { } } return at; -}; \ No newline at end of file +} \ No newline at end of file