Skip to content

Commit f0910e6

Browse files
authored
add 'NO_GLOBAL_UPDATE' define to avoid creating global UpdateClass instance (espressif#8500)
Save 180 bytes of ram if UpdateClass instance is not required
1 parent dbc060b commit f0910e6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

libraries/Update/src/Update.h

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ class UpdateClass {
190190
uint8_t _ledOn;
191191
};
192192

193+
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
193194
extern UpdateClass Update;
195+
#endif
194196

195197
#endif

libraries/Update/src/Updater.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -414,4 +414,6 @@ bool UpdateClass::_chkDataInBlock(const uint8_t *data, size_t len) const {
414414
return false;
415415
}
416416

417+
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
417418
UpdateClass Update;
419+
#endif

0 commit comments

Comments
 (0)