1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-04-17 00:15:25 +00:00

Use a memory barrier instead of a hack

This commit is contained in:
Gyorgy Szombathelyi
2021-08-25 23:42:02 +02:00
parent f0d9e28932
commit ae9e24811c
2 changed files with 3 additions and 9 deletions

View File

@@ -34,7 +34,7 @@
* Public functions
*----------------------------------------------------------------------------*/
#if defined(CONFIG_ARCH_ARMV5TE)
#if defined(CONFIG_ARCH_ARMV5TE) || defined(CONFIG_ARCH_ARMV4TE)
static inline void dmb(void)
{

View File

@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "errors.h"
#include "hardware.h"
#include "irqflags.h"
#include "barriers.h"
#include "fat_compat.h"
#include "firmware.h"
@@ -197,19 +198,12 @@ RAMFUNC void WriteFirmware(char *name)
if(size & 2048) DISKLED_ON
else DISKLED_OFF;
#ifndef GCC_OPTIMZES_TOO_MUCH // the latest gcc 4.8.0 calls memcpy for this
i = FLASH_PAGESIZE / 4;
while (i--)
*pDst++ = *pSrc++;
#else
i = FLASH_PAGESIZE / 8;
while (i--) {
*pDst++ = *pSrc++;
*pDst++ = *pSrc++;
dmb();
}
#endif
WriteFlash(page);
page++;
}