From bc60e97489fee09002156b33421c9df1e3b4fd95 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 10 Nov 2019 22:07:51 +0100 Subject: [PATCH] board NodeMCUv1 menu: led selection (2, 16) (#6748) --- boards.txt | 4 ++++ tools/boards.txt.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/boards.txt b/boards.txt index f19cc72b6..e873cdb57 100644 --- a/boards.txt +++ b/boards.txt @@ -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 diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 53964bbc0..a40c5f885 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -42,6 +42,7 @@ import json 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 @@ -57,6 +58,7 @@ speeds = collections.OrderedDict([ ( '3000', [ 's3000','s57', 's115', 's230', 's256', 's460', 's512', 's921' ]), ]) +################################################################ # boards list boards = collections.OrderedDict([ @@ -467,6 +469,7 @@ boards = collections.OrderedDict([ '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.', '', @@ -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 @@ -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: