Skip to content

Commit

Permalink
add 'NO_GLOBAL_UPDATE' define to avoid creating global UpdateClass in…
Browse files Browse the repository at this point in the history
…stance (#8500)

Save 180 bytes of ram if UpdateClass instance is not required
  • Loading branch information
vortigont authored Aug 29, 2023
1 parent dbc060b commit f0910e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/Update/src/Update.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ class UpdateClass {
uint8_t _ledOn;
};

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
extern UpdateClass Update;
#endif

#endif
2 changes: 2 additions & 0 deletions libraries/Update/src/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,6 @@ bool UpdateClass::_chkDataInBlock(const uint8_t *data, size_t len) const {
return false;
}

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
UpdateClass Update;
#endif

0 comments on commit f0910e6

Please sign in to comment.