Skip to content

Commit bc60e97

Browse files
authored
board NodeMCUv1 menu: led selection (2, 16) (esp8266#6748)
1 parent 4e5bf11 commit bc60e97

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

boards.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,6 +2610,10 @@ nodemcuv2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld
26102610
nodemcuv2.menu.eesz.4M.build.spiffs_pagesize=256
26112611
nodemcuv2.menu.eesz.4M.upload.maximum_size=1044464
26122612
nodemcuv2.menu.eesz.4M.build.rfcal_addr=0x3FC000
2613+
nodemcuv2.menu.led.2=2
2614+
nodemcuv2.menu.led.2.build.led=-DLED_BUILTIN=2
2615+
nodemcuv2.menu.led.16=16
2616+
nodemcuv2.menu.led.16.build.led=-DLED_BUILTIN=16
26132617
nodemcuv2.menu.ip.lm2f=v2 Lower Memory
26142618
nodemcuv2.menu.ip.lm2f.build.lwip_include=lwip2/include
26152619
nodemcuv2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat

tools/boards.txt.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
requiredboards = [ 'generic', 'esp8285' ]
4444

45+
################################################################
4546
# serial upload speed order in menu
4647
# default is 115 for every board unless specified with 'serial' in board
4748
# or by user command line
@@ -57,6 +58,7 @@
5758
( '3000', [ 's3000','s57', 's115', 's230', 's256', 's460', 's512', 's921' ]),
5859
])
5960

61+
################################################################
6062
# boards list
6163

6264
boards = collections.OrderedDict([
@@ -467,6 +469,7 @@
467469
'flashmode_dio',
468470
'flashfreq_40',
469471
'4M',
472+
'led216',
470473
],
471474
'desc': [ 'This module is sold under many names for around $6.50 on AliExpress and it\'s one of the cheapest, fully integrated ESP8266 solutions.',
472475
'',
@@ -1435,19 +1438,19 @@ def all_flash_map ():
14351438
################################################################
14361439
# builtin led
14371440

1438-
def led (default,max):
1441+
def led (name, default, ledList):
14391442
led = collections.OrderedDict([
14401443
('.menu.led.' + str(default), str(default)),
14411444
('.menu.led.' + str(default) + '.build.led', '-DLED_BUILTIN=' + str(default)),
14421445
]);
1443-
for i in range(0,max+1): # Make range incluside of max (16), since there are really 16 GPIOS not 15
1446+
for i in ledList: # Make range incluside of max (16), since there are really 16 GPIOS not 15
14441447
if not i == default:
14451448
led.update(
14461449
collections.OrderedDict([
14471450
('.menu.led.' + str(i), str(i)),
14481451
('.menu.led.' + str(i) + '.build.led', '-DLED_BUILTIN=' + str(i)),
14491452
]))
1450-
return { 'led': led }
1453+
return { name: led }
14511454

14521455
################################################################
14531456
# sdk selection
@@ -1495,7 +1498,8 @@ def all_boards ():
14951498

14961499
macros.update(all_flash_map())
14971500
macros.update(all_debug())
1498-
macros.update(led(led_default, led_max))
1501+
macros.update(led('led', led_default, range(0,led_max+1)))
1502+
macros.update(led('led216', 2, { 16 }))
14991503
macros.update(sdk())
15001504

15011505
if boardfilteropt or excludeboards:

0 commit comments

Comments
 (0)