Skip to content

board nodeMCUv1: +led menu (2, 16) #6748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,10 @@ nodemcuv2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld
nodemcuv2.menu.eesz.4M.build.spiffs_pagesize=256
nodemcuv2.menu.eesz.4M.upload.maximum_size=1044464
nodemcuv2.menu.eesz.4M.build.rfcal_addr=0x3FC000
nodemcuv2.menu.led.2=2
nodemcuv2.menu.led.2.build.led=-DLED_BUILTIN=2
nodemcuv2.menu.led.16=16
nodemcuv2.menu.led.16.build.led=-DLED_BUILTIN=16
nodemcuv2.menu.ip.lm2f=v2 Lower Memory
nodemcuv2.menu.ip.lm2f.build.lwip_include=lwip2/include
nodemcuv2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat
Expand Down
12 changes: 8 additions & 4 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

requiredboards = [ 'generic', 'esp8285' ]

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

################################################################
# boards list

boards = collections.OrderedDict([
Expand Down Expand Up @@ -467,6 +469,7 @@
'flashmode_dio',
'flashfreq_40',
'4M',
'led216',
],
'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.',
'',
Expand Down Expand Up @@ -1435,19 +1438,19 @@ def all_flash_map ():
################################################################
# builtin led

def led (default,max):
def led (name, default, ledList):
led = collections.OrderedDict([
('.menu.led.' + str(default), str(default)),
('.menu.led.' + str(default) + '.build.led', '-DLED_BUILTIN=' + str(default)),
]);
for i in range(0,max+1): # Make range incluside of max (16), since there are really 16 GPIOS not 15
for i in ledList: # Make range incluside of max (16), since there are really 16 GPIOS not 15
if not i == default:
led.update(
collections.OrderedDict([
('.menu.led.' + str(i), str(i)),
('.menu.led.' + str(i) + '.build.led', '-DLED_BUILTIN=' + str(i)),
]))
return { 'led': led }
return { name: led }

################################################################
# sdk selection
Expand Down Expand Up @@ -1495,7 +1498,8 @@ def all_boards ():

macros.update(all_flash_map())
macros.update(all_debug())
macros.update(led(led_default, led_max))
macros.update(led('led', led_default, range(0,led_max+1)))
macros.update(led('led216', 2, { 16 }))
macros.update(sdk())

if boardfilteropt or excludeboards:
Expand Down