Preallocate enough vectors for common app settings #1535

This commit is contained in:
Mark Thompson 2023-10-30 05:32:01 -05:00 committed by GitHub
parent 0bacb31d17
commit a11929d2ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -42,6 +42,8 @@
// Bring in the string_view literal.
using std::literals::operator""sv;
#define COMMON_APP_SETTINGS_COUNT 19
/* Represents a named setting bound to a variable instance. */
/* Using void* instead of std::variant, because variant is a pain to dispatch over. */
class BoundSetting {
@ -143,8 +145,8 @@ struct AppSettings {
uint8_t nbfm_config_index = 0;
uint8_t wfm_config_index = 0;
uint8_t squelch = 80;
uint8_t volume;
// NOTE: update COMMON_APP_SETTINGS_COUNT when adding to this
};
/* Copies common values to the receiver/transmitter models. */