Merge pull request #2167 from prusa3d/MK3_3.8.0

Mk3 3.8.0
This commit is contained in:
Marek Běl 2019-09-05 19:03:37 +02:00 committed by GitHub
commit 9a60dd259b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,14 +97,66 @@ void eeprom_init()
//! @brief Get default sheet name for index //! @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[in] index
//! @param[out] sheetName //! @param[out] sheetName
void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName)
{ {
static_assert(8 == sizeof(SheetName),"Default sheet name needs to be adjusted."); 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'; sheetName.c[7] = '\0';
} }