#include <cpu_def.h>
#include <hal_machperiph.h>
+#define IAP_PLL_FULL_SPEED 1
+
#define CMD_SUCCESS 0
#define BUSY 11
{
return addr/0x2000;
}
-#elif defined INC_LPC214x_H
+#elif defined INC_LPC214x_H || defined INC_LPC2348_H
inline int addr2sec(unsigned long addr)
{
if (addr<0x8000) return (addr>>12);
if (end<start) return 0;
save_and_cli(flags);
+ #ifndef IAP_PLL_FULL_SPEED
lpc_pll_off();
+ #endif
lpcisp_prepare_sectors(start,end);
if (CMD_SUCCESS != *result) return 0;
lpcisp_erase_sectors(start,end);
+ #ifndef IAP_PLL_FULL_SPEED
lpc_pll_on();
+ #endif
restore_flags(flags);
return (CMD_SUCCESS == *result);
end=start;
save_and_cli(flags);
+ #ifndef IAP_PLL_FULL_SPEED
lpc_pll_off();
+ #endif
lpcisp_prepare_sectors(start,end);
if (CMD_SUCCESS != *result) return 0;
iap_entry(command, result);
+ #ifndef IAP_PLL_FULL_SPEED
lpc_pll_on();
+ #endif
restore_flags(flags);
return (CMD_SUCCESS == *result);