Exemplo n.º 1
0
void flashc_issue_command(unsigned int command, int page_number)
{
  u_avr32_flashc_fcmd_t u_avr32_flashc_fcmd;
  flashc_wait_until_ready();
  u_avr32_flashc_fcmd.fcmd = AVR32_FLASHC.fcmd;
  u_avr32_flashc_fcmd.FCMD.cmd = command;
  if (page_number >= 0) u_avr32_flashc_fcmd.FCMD.pagen = page_number;
  u_avr32_flashc_fcmd.FCMD.key = AVR32_FLASHC_FCMD_KEY_KEY;
  AVR32_FLASHC.fcmd = u_avr32_flashc_fcmd.fcmd;
  flashc_error_status = flashc_get_error_status();
  flashc_wait_until_ready();
}
void flashc_issue_command (unsigned int command, int page_number)
{
    u_avr32_flashc_fcmd_t u_avr32_flashc_fcmd;
    flashc_wait_until_ready ();
    u_avr32_flashc_fcmd.fcmd = AVR32_FLASHC.fcmd;
    u_avr32_flashc_fcmd.FCMD.cmd = command;
    if (page_number >= 0)
        u_avr32_flashc_fcmd.FCMD.pagen = page_number;
    u_avr32_flashc_fcmd.FCMD.key = AVR32_FLASHC_FCMD_KEY_KEY;
    AVR32_FLASHC.fcmd = u_avr32_flashc_fcmd.fcmd;
    flashc_error_status = flashc_get_error_status ();
    flashc_wait_until_ready ();
#ifdef DEBUG_FLASHC
    {
    unsigned char text[20];
        CI_LocalPrintf ("Flash page :");
        itoa ((unsigned int) u_avr32_flashc_fcmd.FCMD.pagen, text);
        CI_LocalPrintf (text);
        CI_LocalPrintf ("\n\r");
    }
#endif

}