-
Notifications
You must be signed in to change notification settings - Fork 13.3k
provide full version descriptor, displayed in debug mode #4467
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
Changes from all commits
a0d16f6
8b57529
92b360b
ae0258e
74aab7e
dae3932
dbd0126
1dc99d6
613f873
6dc6514
4eb01a1
d55d501
1e04a77
982c5a0
85945a1
ee70fd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Esp.cpp - ESP8266-specific APIs | ||
Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. | ||
This file is part of the esp8266 core for Arduino environment. | ||
|
||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
|
||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <user_interface.h> | ||
#include <core_version.h> | ||
#include <lwip/init.h> // LWIP_VERSION_* | ||
#include <lwipopts.h> // LWIP_HASH_STR (lwip2) | ||
|
||
#define STRHELPER(x) #x | ||
#define STR(x) STRHELPER(x) // stringifier | ||
|
||
static const char arduino_esp8266_git_ver [] PROGMEM = STR(ARDUINO_ESP8266_GIT_DESC); | ||
#if LWIP_VERSION_MAJOR != 1 | ||
static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION); | ||
#endif | ||
|
||
String EspClass::getFullVersion() | ||
{ | ||
return String(F("SDK:")) + system_get_sdk_version() | ||
+ F("/Core:") + FPSTR(arduino_esp8266_git_ver) | ||
#if LWIP_VERSION_MAJOR == 1 | ||
+ F("/lwIP:") + String(LWIP_VERSION_MAJOR) + "." + String(LWIP_VERSION_MINOR) + "." + String(LWIP_VERSION_REVISION) | ||
#else | ||
+ FPSTR(lwip2_version) | ||
#endif | ||
#if LWIP_VERSION_IS_DEVELOPMENT | ||
+ F("-dev") | ||
#endif | ||
#if LWIP_VERSION_IS_RC | ||
+ F("rc") + String(LWIP_VERSION_RC) | ||
#endif | ||
#ifdef LWIP_HASH_STR | ||
+ "(" + F(LWIP_HASH_STR) + ")" | ||
#endif | ||
; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,15 @@ $SED 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/ | |
$SED 's/runtime.tools.esptool.path={runtime.platform.path}\/tools\/esptool//g' | \ | ||
$SED 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' | \ | ||
$SED 's/tools.mkspiffs.path={runtime.platform.path}\/tools\/mkspiffs/tools.mkspiffs.path=\{runtime.tools.mkspiffs.path\}/g' |\ | ||
$SED 's/recipe.hooks.core.prebuild.1.pattern.*//g' \ | ||
$SED 's/recipe.hooks.core.prebuild.1.pattern.*//g' |\ | ||
$SED 's/recipe.hooks.core.prebuild.2.pattern.*//g' \ | ||
> $outdir/platform.txt | ||
|
||
# Put core version and short hash of git version into core_version.h | ||
ver_define=`echo $plain_ver | tr "[:lower:].\055" "[:upper:]_"` | ||
echo Ver define: $ver_define | ||
echo \#define ARDUINO_ESP8266_GIT_VER 0x`git rev-parse --short=8 HEAD 2>/dev/null` >$outdir/cores/esp8266/core_version.h | ||
echo \#define ARDUINO_ESP8266_GIT_DESC `git describe --tags 2>/dev/null` >>$outdir/cores/esp8266/core_version.h | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few lines above (can't comment on the line directly...) there is
Since you have added 2.pattern, please add one more SED line to remove 2.pattern, then run the script and check that the prebuild hooks are removed from platform.txt in the built archive. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. I had to rebase to push the fix. |
||
echo \#define ARDUINO_ESP8266_RELEASE_$ver_define >>$outdir/cores/esp8266/core_version.h | ||
echo \#define ARDUINO_ESP8266_RELEASE \"$ver_define\" >>$outdir/cores/esp8266/core_version.h | ||
|
||
|
+2 −0 | README.md | |
+23 −7 | glue-esp/lwip-esp.c | |
+16 −2 | glue-lwip/lwip-git.c | |
+1 −1 | glue/doprint.c | |
+9 −5 | glue/gluedebug.h | |
+4 −4 | makefiles/Makefile.build-lwip2 | |
+4 −5 | makefiles/make-lwip-hash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// generated by makefiles/make-lwip2-hash | ||
#ifndef LWIP_HASH_H | ||
#define LWIP_HASH_H | ||
#define LWIP_HASH 0x92f23d6 | ||
#define LWIP_HASH_STR "92f23d6(tag:STABLE-2_0_3_RELEASE)" | ||
#define LWIP_HASH_STR "STABLE-2_0_3_RELEASE/glue:arduino-2.4.1" | ||
#endif // LWIP_HASH_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header missing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added