mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-17 12:02:15 +03:00
small addons (#5847)
* make (static) ESP8266WebServer::responseCodeToString visible and usable * esp8266:coreVersionNumeric(): add a define and comment-example to check on its usability
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
#ifndef __CORE_ESP8266_VERSION_H
|
||||
#define __CORE_ESP8266_VERSION_H
|
||||
|
||||
#define HAS_ESP8266_VERSION_NUMERIC 1
|
||||
|
||||
#include <core_version.h>
|
||||
|
||||
#define __STRHELPER(x) #x
|
||||
@ -52,6 +54,20 @@ extern "C++"
|
||||
// esp8266CoreVersionSubRevision() is 3 Numeric is: 20499903
|
||||
// case 2.5.0:
|
||||
// esp8266CoreVersionSubRevision() is 0 Numeric is: 20500000
|
||||
//
|
||||
// Using esp8266::coreVersionNumeric() in a portable way:
|
||||
//
|
||||
// #if HAS_ESP8266_VERSION_NUMERIC
|
||||
// if (esp8266::coreVersionNumeric() >= 20500042)
|
||||
// {
|
||||
// // modern api can be used
|
||||
// }
|
||||
// else
|
||||
// #endif
|
||||
// {
|
||||
// // code using older api
|
||||
// // (will not be compiled in when newer api is usable)
|
||||
// }
|
||||
|
||||
namespace conststr {
|
||||
|
||||
|
Reference in New Issue
Block a user