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:
@@ -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)
|
||||
{
|
||||
|
||||
10
firmware.c
10
firmware.c
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user