소스 검색

Merge pull request #2166 from mkbel/rename_default_sheets

Change default sheet names.
DRracer 4 년 전
부모
커밋
3aa5637838
1개의 변경된 파일54개의 추가작업 그리고 2개의 파일을 삭제
  1. 54 2
      Firmware/eeprom.cpp

+ 54 - 2
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';
 }