comparison Discovery/Src/tComm.c @ 1056:b241efe09963 Icon_Integration tip

Icon upload: added icon size check: The size of the icon is limited to 128k. To avoid overwritten data (font would no longer be shown correct) in case a larger icon is send, a size check has been added before floshing the icon.
author Ideenmodellierer
date Sat, 03 Jan 2026 20:42:09 +0100
parents 36fa1c44e597
children
comparison
equal deleted inserted replaced
1055:de56b8d75504 1056:b241efe09963
1828 } 1828 }
1829 } 1829 }
1830 else 1830 else
1831 if(id == id_ICON) 1831 if(id == id_ICON)
1832 { 1832 {
1833 firmware2_variable_upperpart_eraseFlashMemory(length1Work,0); /* flash is not in use => can be written immediately */ 1833 if(length1Work < 0x20000) /* Flash sectors 12-16 are used for icon => limited to 128K */
1834 firmware2_variable_upperpart_programFlashMemory(length1Work,0,pBuffer1,length1Work,0); 1834 {
1835 ByteCompareStatus = 0; /* trust flashing for image use case */ 1835 firmware2_variable_upperpart_eraseFlashMemory(length1Work,0); /* flash is not in use => can be written immediately */
1836 firmware2_variable_upperpart_programFlashMemory(length1Work,0,pBuffer1,length1Work,0);
1837 ByteCompareStatus = 0; /* trust flashing for image use case */
1838 }
1839 else
1840 {
1841 ByteCompareStatus = 1;
1842 }
1836 } 1843 }
1837 1844
1838 releaseFrame(20,(uint32_t)pBufferCompare); 1845 releaseFrame(20,(uint32_t)pBufferCompare);
1839 1846
1840 if(ByteCompareStatus != 0) 1847 if(ByteCompareStatus != 0)