X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcc1111%2Fao_intflash.c;h=154b3c252c1db4549869d4efd7b9ecd815c4375d;hb=db12c17e9538bd82f2c2bf21357887ee7d894a1c;hp=d76d954e16a071f2cf7f924fd8ac676964f0673e;hpb=1c344b760776cd5d8c0297d8db9bf02687381b4e;p=fw%2Faltos diff --git a/src/cc1111/ao_intflash.c b/src/cc1111/ao_intflash.c index d76d954e..154b3c25 100644 --- a/src/cc1111/ao_intflash.c +++ b/src/cc1111/ao_intflash.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -129,6 +130,8 @@ ao_intflash_write_aligned(uint16_t pos, __xdata void *d, uint16_t len) __reentra nop _endasm; } + __critical while (!ao_intflash_dma_done) + ao_sleep(&ao_intflash_dma_done); } static void @@ -180,7 +183,7 @@ ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant { if (pos >= ao_storage_total || pos + len > ao_storage_total) return 0; - memcpy(d, ao_intflash+pos, len); + ao_xmemcpy(d, ao_intflash+pos, len); return 1; }