Skip to content

Commit

Permalink
fix boards.txt.py with python3 (esp8266#5887)
Browse files Browse the repository at this point in the history
* fix boards.txt.py with python3

* fix boards.txt.py to generate same order when using python2 or python3
  • Loading branch information
d-a-v authored Mar 16, 2019
1 parent a3ea816 commit d19fc3b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
46 changes: 23 additions & 23 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4475,25 +4475,25 @@ espinotee.menu.baud.921600.upload.speed=921600

##############################################################
wifinfo.name=WifInfo
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464
wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
wifinfo.build.board=WIFINFO
wifinfo.build.variant=wifinfo
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000
wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
wifinfo.build.board=WIFINFO
wifinfo.build.variant=wifinfo
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256
wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464
wifinfo.upload.tool=esptool
wifinfo.upload.maximum_data_size=81920
wifinfo.upload.wait_for_upload_port=true
Expand Down Expand Up @@ -4719,19 +4719,19 @@ wifinfo.menu.baud.921600.upload.speed=921600

##############################################################
arduino-esp8266.name=Arduino
arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
arduino-esp8266.build.board=ESP8266_ARDUINO
arduino-esp8266.menu.BoardModel.primo=Primo
arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
arduino-esp8266.menu.BoardModel.primo=Primo
arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO
arduino-esp8266.build.board=ESP8266_ARDUINO
arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
arduino-esp8266.upload.tool=esptool
arduino-esp8266.upload.maximum_data_size=81920
arduino-esp8266.upload.wait_for_upload_port=true
Expand Down
78 changes: 39 additions & 39 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,27 +673,27 @@
}),
( 'wifinfo', {
'name': 'WifInfo',
'opts': {
'.build.board': 'WIFINFO',
'.build.variant': 'wifinfo',
'.menu.ESPModule.ESP07192': 'ESP07 (1M/192K SPIFFS)',
'.menu.ESPModule.ESP07192.build.board': 'ESP8266_ESP07',
'.menu.ESPModule.ESP07192.build.flash_size': '1M',
'.menu.ESPModule.ESP07192.build.flash_ld': 'eagle.flash.1m192.ld',
'.menu.ESPModule.ESP07192.build.spiffs_start': '0xCB000',
'.menu.ESPModule.ESP07192.build.spiffs_end': '0xFB000',
'.menu.ESPModule.ESP07192.build.spiffs_blocksize': '4096',
'.menu.ESPModule.ESP07192.upload.maximum_size': '827376',
'.menu.ESPModule.ESP12': 'ESP12 (4M/1M SPIFFS)',
'.menu.ESPModule.ESP12.build.board': 'ESP8266_ESP12',
'.menu.ESPModule.ESP12.build.flash_size': '4M',
'.menu.ESPModule.ESP12.build.flash_ld': 'eagle.flash.4m1m.ld',
'.menu.ESPModule.ESP12.build.spiffs_start': '0x300000',
'.menu.ESPModule.ESP12.build.spiffs_end': '0x3FB000',
'.menu.ESPModule.ESP12.build.spiffs_blocksize': '8192',
'.menu.ESPModule.ESP12.build.spiffs_pagesize': '256',
'.menu.ESPModule.ESP12.upload.maximum_size': '1044464',
},
'opts': collections.OrderedDict([
( '.build.board', 'WIFINFO' ),
( '.build.variant', 'wifinfo' ),
( '.menu.ESPModule.ESP07192', 'ESP07 (1M/192K SPIFFS)' ),
( '.menu.ESPModule.ESP07192.build.board', 'ESP8266_ESP07' ),
( '.menu.ESPModule.ESP07192.build.flash_size', '1M' ),
( '.menu.ESPModule.ESP07192.build.flash_ld', 'eagle.flash.1m192.ld' ),
( '.menu.ESPModule.ESP07192.build.spiffs_start', '0xCB000' ),
( '.menu.ESPModule.ESP07192.build.spiffs_end', '0xFB000' ),
( '.menu.ESPModule.ESP07192.build.spiffs_blocksize', '4096' ),
( '.menu.ESPModule.ESP07192.upload.maximum_size', '827376' ),
( '.menu.ESPModule.ESP12', 'ESP12 (4M/1M SPIFFS)' ),
( '.menu.ESPModule.ESP12.build.board', 'ESP8266_ESP12' ),
( '.menu.ESPModule.ESP12.build.flash_size', '4M' ),
( '.menu.ESPModule.ESP12.build.flash_ld', 'eagle.flash.4m1m.ld' ),
( '.menu.ESPModule.ESP12.build.spiffs_start', '0x300000' ),
( '.menu.ESPModule.ESP12.build.spiffs_end', '0x3FB000' ),
( '.menu.ESPModule.ESP12.build.spiffs_blocksize', '8192' ),
( '.menu.ESPModule.ESP12.build.spiffs_pagesize', '256' ),
( '.menu.ESPModule.ESP12.upload.maximum_size', '1044464' ),
]),
'macro': [
'resetmethod_nodemcu',
'flashmode_qio',
Expand All @@ -707,21 +707,21 @@
}),
( 'arduino-esp8266', {
'name': 'Arduino',
'opts': {
'.build.board': 'ESP8266_ARDUINO',
'.menu.BoardModel.primo': 'Primo',
'.menu.BoardModel.primo.build.board': 'ESP8266_ARDUINO_PRIMO',
'.menu.BoardModel.primo.build.variant': 'arduino_spi',
'.menu.BoardModel.primo.build.extra_flags': '-DF_CRYSTAL=40000000 -DESP8266',
'.menu.BoardModel.unowifideved': 'Uno WiFi',
'.menu.BoardModel.unowifideved.build.board': 'ESP8266_ARDUINO_UNOWIFI',
'.menu.BoardModel.unowifideved.build.variant': 'arduino_uart',
'.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL': '40000000 -DESP8266',
'.menu.BoardModel.starottodeved': 'Star OTTO',
'.menu.BoardModel.starottodeved.build.variant': 'arduino_uart',
'.menu.BoardModel.starottodeved.build.board': 'ESP8266_ARDUINO_STAR_OTTO',
'.menu.BoardModel.starottodeved.build.extra_flags': '-DF_CRYSTAL=40000000 -DESP8266',
},
'opts': collections.OrderedDict([
( '.build.board', 'ESP8266_ARDUINO' ),
( '.menu.BoardModel.primo', 'Primo' ),
( '.menu.BoardModel.primo.build.board', 'ESP8266_ARDUINO_PRIMO' ),
( '.menu.BoardModel.primo.build.variant', 'arduino_spi' ),
( '.menu.BoardModel.primo.build.extra_flags', '-DF_CRYSTAL=40000000 -DESP8266' ),
( '.menu.BoardModel.unowifideved', 'Uno WiFi' ),
( '.menu.BoardModel.unowifideved.build.board', 'ESP8266_ARDUINO_UNOWIFI' ),
( '.menu.BoardModel.unowifideved.build.variant', 'arduino_uart' ),
( '.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL', '40000000 -DESP8266' ),
( '.menu.BoardModel.starottodeved', 'Star OTTO' ),
( '.menu.BoardModel.starottodeved.build.variant', 'arduino_uart' ),
( '.menu.BoardModel.starottodeved.build.board', 'ESP8266_ARDUINO_STAR_OTTO' ),
( '.menu.BoardModel.starottodeved.build.extra_flags', '-DF_CRYSTAL=40000000 -DESP8266' ),
]),
'macro': [
'resetmethod_ck',
'flashmode_qio',
Expand Down Expand Up @@ -1177,9 +1177,9 @@ def flash_map (flashsize_kb, spiffs_kb = 0):
else:
spiffs_blocksize = 8192

strsize = str(flashsize_kb / 1024) + 'M' if (flashsize_kb >= 1024) else str(flashsize_kb) + 'K'
strspiffs = str(spiffs_kb / 1024) + 'M' if (spiffs_kb >= 1024) else str(spiffs_kb) + 'K'
strspiffs_strip = str(spiffs_kb / 1024) + 'M' if (spiffs_kb >= 1024) else str(spiffs_kb) if (spiffs_kb > 0) else ''
strsize = str(int(flashsize_kb / 1024)) + 'M' if (flashsize_kb >= 1024) else str(flashsize_kb) + 'K'
strspiffs = str(int(spiffs_kb / 1024)) + 'M' if (spiffs_kb >= 1024) else str(spiffs_kb) + 'K'
strspiffs_strip = str(int(spiffs_kb / 1024)) + 'M' if (spiffs_kb >= 1024) else str(spiffs_kb) if (spiffs_kb > 0) else ''

ld = 'eagle.flash.' + strsize.lower() + strspiffs_strip.lower() + '.ld'
menu = '.menu.eesz.' + strsize + strspiffs_strip
Expand Down

0 comments on commit d19fc3b

Please sign in to comment.