Bool flashc_erase_page (int page_number, Bool check)
{
Bool page_erased = TRUE;

#ifdef DEBUG_FLASHC
    {
unsigned char text[20];
        CI_LocalPrintf ("Erase page :");
        itoa ((unsigned int) page_number, text);
        CI_LocalPrintf (text);
        CI_LocalPrintf (" - Pagebuffer = ");
        itoa ((unsigned int) flashc_get_page_number (), text);
        CI_LocalPrintf (text);
        CI_LocalPrintf ("\n\r");
    }
#endif

    flashc_issue_command (AVR32_FLASHC_FCMD_CMD_EP, page_number);
    if (check)
    {
unsigned int error_status = flashc_error_status;
        page_erased = flashc_quick_page_read (-1);
        flashc_error_status |= error_status;
    }
    return page_erased;
}
Esempio n. 2
0
bool flashc_erase_page(int page_number, bool check)
{
	bool page_erased = true;

	flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EP, page_number);
	if (check) {
		unsigned int error_status = flashc_error_status;
		page_erased = flashc_quick_page_read(-1);
		flashc_error_status |= error_status;
	}
	return page_erased;
}