2023-09-09 12:19:22 +03:00
|
|
|
|
# правим %USERPROFILE%\.platformio\platforms\espressif8266\builder\main.py 103-115
|
|
|
|
|
|
# для добавления возможности прошивки 16мб модуля esp8266
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
import shutil
|
2023-10-07 22:24:17 +03:00
|
|
|
|
from sys import platform
|
2023-09-09 12:19:22 +03:00
|
|
|
|
|
2023-10-07 22:24:17 +03:00
|
|
|
|
if platform == "linux" or platform == "linux2":
|
|
|
|
|
|
# linux
|
2024-06-07 19:31:52 +03:00
|
|
|
|
mainPyPath = '/home/rise/.platformio/platforms/espressif8266@4.0.1/builder/main.py'
|
2023-10-07 22:24:17 +03:00
|
|
|
|
else:
|
|
|
|
|
|
# windows
|
|
|
|
|
|
mainPyPath = os.environ['USERPROFILE'] + '\\.platformio\\platforms\\espressif8266@4.0.1\\builder\\main.py'
|
2023-09-09 12:19:22 +03:00
|
|
|
|
|
2023-10-07 22:24:17 +03:00
|
|
|
|
# print(mainPyPath)
|
2023-09-09 12:19:22 +03:00
|
|
|
|
|
|
|
|
|
|
with open(mainPyPath) as fr:
|
|
|
|
|
|
oldData = fr.read()
|
|
|
|
|
|
if not 'if _value == -0x6000:' in oldData:
|
|
|
|
|
|
shutil.copyfile(mainPyPath, mainPyPath+'.bak')
|
|
|
|
|
|
newData = oldData.replace('_value += 0xE00000 # correction', '_value += 0xE00000 # correction\n\n if _value == -0x6000:\n _value = env[k]-0x40200000')
|
|
|
|
|
|
with open(mainPyPath, 'w') as fw:
|
2024-06-07 19:31:52 +03:00
|
|
|
|
fw.write(newData)
|