Fix profiling compile time warnings

This commit is contained in:
Theo Arends 2021-11-03 10:42:30 +01:00
parent 5573ff4082
commit eedaef0928
3 changed files with 39 additions and 7 deletions

View File

@ -1053,6 +1053,15 @@
//#define DEBUG_TASMOTA_SENSOR // Enable sensor debug messages //#define DEBUG_TASMOTA_SENSOR // Enable sensor debug messages
//#define USE_DEBUG_DRIVER // Use xdrv_99_debug.ino providing commands CpuChk, CfgXor, CfgDump, CfgPeek and CfgPoke //#define USE_DEBUG_DRIVER // Use xdrv_99_debug.ino providing commands CpuChk, CfgXor, CfgDump, CfgPeek and CfgPoke
/*********************************************************************************************\
* Profiling features
\*********************************************************************************************/
//#define USE_PROFILING // Enable profiling
//#define PROFILE_THRESHOLD 70 // Minimum duration in milliseconds to start logging
//#define USE_PROFILE_DRIVER // Enable driver profiling
//#define USE_PROFILE_FUNCTION // Enable driver function profiling
/*********************************************************************************************\ /*********************************************************************************************\
* Optional firmware configurations * Optional firmware configurations
* Select none or just one for optional features and sensors as configured in tasmota_configurations.h * Select none or just one for optional features and sensors as configured in tasmota_configurations.h

View File

@ -17,16 +17,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
//#define USE_PROFILING
#define PROFILE_THRESHOLD 70 // Minimum duration in milliseconds to start logging
//#define USE_PROFILE_DRIVER
#define USE_PROFILE_FUNCTION
/*********************************************************************************************\ /*********************************************************************************************\
* Profiling features * Profiling features
\*********************************************************************************************/ \*********************************************************************************************/
// Moved to my_user_config.h (and user_config_override.h)
//#define USE_PROFILING // Enable profiling
//#define PROFILE_THRESHOLD 70 // Minimum duration in milliseconds to start logging
//#define USE_PROFILE_DRIVER // Enable driver profiling
//#define USE_PROFILE_FUNCTION // Enable driver function profiling
/*
// Moved to tasmota_globals.h fixing compile warnings
#ifndef USE_PROFILING #ifndef USE_PROFILING
#undef USE_PROFILE_DRIVER #undef USE_PROFILE_DRIVER
#undef USE_PROFILE_FUNCTION #undef USE_PROFILE_FUNCTION
@ -43,13 +45,17 @@
#else #else
#define PROFILE_FUNCTION(DRIVER, INDEX, FUNCTION, START) #define PROFILE_FUNCTION(DRIVER, INDEX, FUNCTION, START)
#endif // USE_PROFILE_DRIVER #endif // USE_PROFILE_DRIVER
*/
/*********************************************************************************************\ /*********************************************************************************************\
* Profiling services * Profiling services
\*********************************************************************************************/ \*********************************************************************************************/
#ifdef USE_PROFILING #ifdef USE_PROFILING
#ifndef PROFILE_THRESHOLD
#define PROFILE_THRESHOLD 70 // Minimum duration in milliseconds to start logging
#endif
// Below needs to be inline with enum XsnsFunctions // Below needs to be inline with enum XsnsFunctions
const char kXSnsFunctions[] PROGMEM = "SETTINGS_OVERRIDE|PIN_STATE|MODULE_INIT|PRE_INIT|INIT|" const char kXSnsFunctions[] PROGMEM = "SETTINGS_OVERRIDE|PIN_STATE|MODULE_INIT|PRE_INIT|INIT|"
"LOOP|EVERY_50_MSECOND|EVERY_100_MSECOND|EVERY_200_MSECOND|EVERY_250_MSECOND|EVERY_SECOND|" "LOOP|EVERY_50_MSECOND|EVERY_100_MSECOND|EVERY_200_MSECOND|EVERY_250_MSECOND|EVERY_SECOND|"

View File

@ -495,6 +495,23 @@ bool first_device_group_is_local = true;
#define SHOW_FREE_MEM(WHERE) #define SHOW_FREE_MEM(WHERE)
#endif #endif
#ifndef USE_PROFILING
#undef USE_PROFILE_DRIVER
#undef USE_PROFILE_FUNCTION
#endif
#ifdef USE_PROFILE_DRIVER
#define PROFILE_DRIVER(DRIVER, FUNCTION, START) AddLogDriver(DRIVER, FUNCTION, START)
#else
#define PROFILE_DRIVER(DRIVER, FUNCTION, START)
#endif // USE_PROFILE_DRIVER
#ifdef USE_PROFILE_FUNCTION
#define PROFILE_FUNCTION(DRIVER, INDEX, FUNCTION, START) AddLogFunction(DRIVER, INDEX, FUNCTION, START)
#else
#define PROFILE_FUNCTION(DRIVER, INDEX, FUNCTION, START)
#endif // USE_PROFILE_DRIVER
/*********************************************************************************************\ /*********************************************************************************************\
* Macro for SetOption synonyms * Macro for SetOption synonyms
* *