From 3a5daf1c64e889951703176be2a958ef030b27e7 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 5 Sep 2019 17:27:21 +0200 Subject: [PATCH] Change default sheet names. --- Firmware/eeprom.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/Firmware/eeprom.cpp b/Firmware/eeprom.cpp index dd1a410b..b33b2c3c 100644 --- a/Firmware/eeprom.cpp +++ b/Firmware/eeprom.cpp @@ -97,14 +97,66 @@ void eeprom_init() //! @brief Get default sheet name for index //! +//! | index | sheetName | +//! | ----- | --------- | +//! | 0 | Smooth1 | +//! | 1 | Smooth2 | +//! | 2 | Textur1 | +//! | 3 | Textur2 | +//! | 4 | Custom1 | +//! | 5 | Custom2 | +//! | 6 | Custom3 | +//! | 7 | Custom4 | +//! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { static_assert(8 == sizeof(SheetName),"Default sheet name needs to be adjusted."); - sprintf_P(sheetName.c, PSTR("%-6.6S"), _T(MSG_SHEET)); - sheetName.c[6] = '1' + index; + if (index < 2) + { + strcpy_P(sheetName.c, PSTR("Smooth")); + } + else if (index < 4) + { + strcpy_P(sheetName.c, PSTR("Textur")); + } + else + { + strcpy_P(sheetName.c, PSTR("Custom")); + } + + switch (index) + { + case 0: + sheetName.c[6] = '1'; + break; + case 1: + sheetName.c[6] = '2'; + break; + case 2: + sheetName.c[6] = '1'; + break; + case 3: + sheetName.c[6] = '2'; + break; + case 4: + sheetName.c[6] = '1'; + break; + case 5: + sheetName.c[6] = '2'; + break; + case 6: + sheetName.c[6] = '3'; + break; + case 7: + sheetName.c[6] = '4'; + break; + default: + break; + } + sheetName.c[7] = '\0'; }