Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditSystem.c @ 1054:8fe6676f28c9 Icon_Integration tip
Restructure reset menu:
The reset for custom icon back to the default has been added. Without modification it would not have fit into the reset menu. To add some space all reset operations have been moved into a general "Reset" menu linke it is also implemented for the reboot options. The icon reset option is only show if an icon is stored.
| author | Ideenmodellierer |
|---|---|
| date | Wed, 31 Dec 2025 17:52:03 +0100 |
| parents | 2af07aa38531 |
| children |
comparison
equal
deleted
inserted
replaced
| 1053:36fa1c44e597 | 1054:8fe6676f28c9 |
|---|---|
| 110 uint8_t OnAction_Maintenance (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 110 uint8_t OnAction_Maintenance (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 111 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 111 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 112 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 112 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 113 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 113 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 114 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 114 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 115 uint8_t OnAction_ResetIcon (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 115 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 116 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 116 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 117 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 117 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 118 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 118 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 119 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 119 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 120 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 1521 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); | 1522 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); |
| 1522 | 1523 |
| 1523 text[0] = TXT_2BYTE; | 1524 text[0] = TXT_2BYTE; |
| 1524 text[2] = 0; | 1525 text[2] = 0; |
| 1525 | 1526 |
| 1526 text[1] = TXT2BYTE_ResetAll; | 1527 text[1] = TXT2BYTE_ResetMenu; |
| 1527 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); | 1528 write_field_button(StMSYS5_Reset, 30, 800, ME_Y_LINE2, &FontT48, text); |
| 1528 | |
| 1529 text[1] = TXT2BYTE_ResetDeco; | |
| 1530 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); | |
| 1531 | 1529 |
| 1532 text[1] = TXT2BYTE_Reboot; | 1530 text[1] = TXT2BYTE_Reboot; |
| 1533 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); | 1531 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE3, &FontT48, text); |
| 1534 | 1532 |
| 1535 text[1] = TXT2BYTE_Maintenance; | 1533 text[1] = TXT2BYTE_Maintenance; |
| 1536 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); | 1534 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE4, &FontT48, text); |
| 1537 | |
| 1538 #ifndef RESETLOGBLOCK | |
| 1539 text[1] = TXT2BYTE_ResetLogbook; | |
| 1540 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
| 1541 #else | |
| 1542 text[0] = '\031'; | |
| 1543 text[1] = TXT_2BYTE; | |
| 1544 text[2] = TXT2BYTE_ResetLogbook; | |
| 1545 text[3] = 0; | |
| 1546 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
| 1547 text[0] = TXT_2BYTE; | |
| 1548 text[2] = 0; | |
| 1549 #endif | |
| 1550 | 1535 |
| 1551 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset); | 1536 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset); |
| 1552 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm); | 1537 setEvent(StMSYS5_Reset, (uint32_t)OnAction_Confirm); |
| 1553 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm); | 1538 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm); |
| 1554 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm); | 1539 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Maintenance); |
| 1555 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Maintenance); | |
| 1556 #ifndef RESETLOGBLOCK | |
| 1557 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm); | |
| 1558 #else | |
| 1559 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing); | |
| 1560 #endif | |
| 1561 | 1540 |
| 1562 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 1541 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
| 1563 } | 1542 } |
| 1564 | 1543 |
| 1565 | 1544 |
| 1566 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) | 1545 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) |
| 1567 { | 1546 { |
| 1568 char text[32]; | 1547 char text[32]; |
| 1548 SIconHeader* pIconHeader = (SIconHeader*) ICON_HEADER_ADDR; | |
| 1549 | |
| 1569 | 1550 |
| 1570 resetMenuEdit(CLUT_MenuPageSystem); | 1551 resetMenuEdit(CLUT_MenuPageSystem); |
| 1571 | 1552 |
| 1572 text[0] = '\001'; | 1553 text[0] = '\001'; |
| 1573 text[1] = TXT_2BYTE; | 1554 text[1] = TXT_2BYTE; |
| 1600 text[2] = TXT2BYTE_DecoDataLost; | 1581 text[2] = TXT2BYTE_DecoDataLost; |
| 1601 text[3] = 0; | 1582 text[3] = 0; |
| 1602 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | 1583 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); |
| 1603 break; | 1584 break; |
| 1604 | 1585 |
| 1586 case StMSYS5_Reset: | |
| 1605 case StMSYS5_ResetDeco: | 1587 case StMSYS5_ResetDeco: |
| 1606 text[1] = TXT2BYTE_ResetDeco; | 1588 case StMSYS5_ResetAll: |
| 1607 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | 1589 case StMSYS5_ResetLogbook: |
| 1590 case StMSYS5_ResetIcon: | |
| 1591 text[1] = TXT2BYTE_ResetDeco; | |
| 1592 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 1593 text[1] = TXT2BYTE_ResetAll; | |
| 1594 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE3, &FontT48, text); | |
| 1595 text[1] = TXT2BYTE_ResetLogbook; | |
| 1596 write_field_button(StMSYS5_ResetLogbook, 30, 800, ME_Y_LINE4, &FontT48, text); | |
| 1597 | |
| 1598 if(pIconHeader->type == 0x20) | |
| 1599 { | |
| 1600 text[1] = TXT2BYTE_ResetIcon; | |
| 1601 write_field_button(StMSYS5_ResetIcon, 30, 800, ME_Y_LINE5, &FontT48, text); | |
| 1602 } | |
| 1608 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | 1603 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
| 1609 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); | 1604 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_ResetDeco); |
| 1610 text[0] = '\025'; | 1605 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_ResetAll); |
| 1611 text[1] = TXT_2BYTE; | 1606 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_ResetLogbook); |
| 1612 text[2] = TXT2BYTE_DecoDataLost; | 1607 if(pIconHeader->type == 0x20) |
| 1613 text[3] = 0; | 1608 { |
| 1614 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | 1609 setEvent(StMSYS5_ResetIcon, (uint32_t)OnAction_ResetIcon); |
| 1615 break; | 1610 } |
| 1616 | |
| 1617 case StMSYS5_ResetAll: | |
| 1618 text[1] = TXT2BYTE_ResetAll; | |
| 1619 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 1620 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | |
| 1621 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); | |
| 1622 break; | |
| 1623 | |
| 1624 case StMSYS5_ResetLogbook: | |
| 1625 text[1] = TXT2BYTE_ResetLogbook; | |
| 1626 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
| 1627 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | |
| 1628 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); | |
| 1629 break; | 1611 break; |
| 1630 } | 1612 } |
| 1631 | 1613 |
| 1632 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 1614 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
| 1633 } | 1615 } |
| 1824 pSettings->logFlashNextSampleStartAddress = 0; | 1806 pSettings->logFlashNextSampleStartAddress = 0; |
| 1825 | 1807 |
| 1826 return EXIT_TO_MENU; | 1808 return EXIT_TO_MENU; |
| 1827 } | 1809 } |
| 1828 | 1810 |
| 1811 uint8_t OnAction_ResetIcon (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1812 { | |
| 1813 SIconHeader* pIconHeader = (SIconHeader*) ICON_HEADER_ADDR; | |
| 1814 uint32_t Address = (uint32_t)&(pIconHeader->type); | |
| 1815 uint64_t clear = 0x0; | |
| 1816 | |
| 1817 HAL_FLASH_Unlock(); | |
| 1818 HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, Address, clear); | |
| 1819 HAL_FLASH_Lock(); | |
| 1820 GFX_build_logo_frame(); | |
| 1821 return EXIT_TO_MENU; | |
| 1822 } | |
| 1829 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1823 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1830 { | 1824 { |
| 1831 settingsGetPointer()->showDebugInfo = 0; | 1825 settingsGetPointer()->showDebugInfo = 0; |
| 1832 extern uint8_t bootToBootloader; | 1826 extern uint8_t bootToBootloader; |
| 1833 bootToBootloader = 1; | 1827 bootToBootloader = 1; |
