mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Board ID as build flag (#8634)
* Board ID as build flag When using IDE or `arduino-cli board list`, show full board name and FQBN ``` $ arduino-cli.exe board list Port Protocol Type Board Name FQBN Core xxx.xxx.x.xxx network Network Port LOLIN(WEMOS) D1 R2 & mini esp8266com:esp8266:d1_mini esp8266com:esp8266 ``` Also add `description` field to the mDNS response containing the original `{build.board}` string value. resolve #7759 * does not work with recent ide (?) * fixup! does not work with recent ide (?)
This commit is contained in:
parent
e149829802
commit
06f34ed566
@ -31,6 +31,11 @@
|
|||||||
#include <lwip/igmp.h>
|
#include <lwip/igmp.h>
|
||||||
#include <lwip/prot/dns.h>
|
#include <lwip/prot/dns.h>
|
||||||
|
|
||||||
|
// should be defined at build time
|
||||||
|
#ifndef ARDUINO_BOARD_ID
|
||||||
|
#define ARDUINO_BOARD_ID "generic"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace esp8266
|
namespace esp8266
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -40,16 +45,6 @@ namespace esp8266
|
|||||||
namespace MDNSImplementation
|
namespace MDNSImplementation
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
STRINGIZE
|
|
||||||
*/
|
|
||||||
#ifndef STRINGIZE
|
|
||||||
#define STRINGIZE(x) #x
|
|
||||||
#endif
|
|
||||||
#ifndef STRINGIZE_VALUE_OF
|
|
||||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
INTERFACE
|
INTERFACE
|
||||||
*/
|
*/
|
||||||
@ -1258,7 +1253,7 @@ namespace MDNSImplementation
|
|||||||
{
|
{
|
||||||
if ((!addServiceTxt(hService, "tcp_check", "no"))
|
if ((!addServiceTxt(hService, "tcp_check", "no"))
|
||||||
|| (!addServiceTxt(hService, "ssh_upload", "no"))
|
|| (!addServiceTxt(hService, "ssh_upload", "no"))
|
||||||
|| (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD)))
|
|| (!addServiceTxt(hService, "board", ARDUINO_BOARD_ID))
|
||||||
|| (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
|
|| (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
|
||||||
{
|
{
|
||||||
removeService(hService);
|
removeService(hService);
|
||||||
|
@ -132,11 +132,6 @@ namespace esp8266
|
|||||||
namespace MDNSImplementation
|
namespace MDNSImplementation
|
||||||
{
|
{
|
||||||
|
|
||||||
// this should be defined at build time
|
|
||||||
#ifndef ARDUINO_BOARD
|
|
||||||
#define ARDUINO_BOARD "generic"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MDNS_IP4_SUPPORT
|
#define MDNS_IP4_SUPPORT
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
//#define MDNS_IP6_SUPPORT
|
//#define MDNS_IP6_SUPPORT
|
||||||
|
@ -128,13 +128,13 @@ recipe.hooks.linking.prelink.3.pattern="{compiler.path}{compiler.c.cmd}" -CC -E
|
|||||||
recipe.hooks.linking.prelink.4.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld"
|
recipe.hooks.linking.prelink.4.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld"
|
||||||
|
|
||||||
## Compile c files
|
## Compile c files
|
||||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_BOARD_ID="{_id}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Compile c++ files
|
## Compile c++ files
|
||||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_BOARD_ID="{_id}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Compile S files
|
## Compile S files
|
||||||
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_BOARD_ID="{_id}" {build.led} {build.flash_flags} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Create archives
|
## Create archives
|
||||||
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
||||||
|
@ -127,6 +127,7 @@ env.Append(
|
|||||||
"_GNU_SOURCE",
|
"_GNU_SOURCE",
|
||||||
("ARDUINO", 10805),
|
("ARDUINO", 10805),
|
||||||
("ARDUINO_BOARD", '\\"PLATFORMIO_%s\\"' % env.BoardConfig().id.upper()),
|
("ARDUINO_BOARD", '\\"PLATFORMIO_%s\\"' % env.BoardConfig().id.upper()),
|
||||||
|
("ARDUINO_BOARD_ID", '\\"%s\\"' % env.BoardConfig().id),
|
||||||
"FLASHMODE_${BOARD_FLASH_MODE.upper()}",
|
"FLASHMODE_${BOARD_FLASH_MODE.upper()}",
|
||||||
"LWIP_OPEN_SRC"
|
"LWIP_OPEN_SRC"
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user