Whitespace.

This commit is contained in:
Gareth McMullin 2015-03-17 20:54:41 -07:00
parent 1366c32f89
commit 5c337c9aa7
1 changed files with 39 additions and 31 deletions

View File

@ -489,7 +489,7 @@ static int samd_flash_erase(struct target_s *target, uint32_t addr, size_t len)
SAMD_CTRLA_CMD_KEY | SAMD_CTRLA_CMD_ERASEROW);
/* Poll for NVM Ready */
while ((target_mem_read32(target, SAMD_NVMC_INTFLAG) & SAMD_NVMC_READY) == 0)
if(target_check_error(target))
if (target_check_error(target))
return -1;
/* Lock */
@ -549,7 +549,7 @@ static int samd_flash_write(struct target_s *target, uint32_t dest,
/* Poll for NVM Ready */
while ((target_mem_read32(target, SAMD_NVMC_INTFLAG) & SAMD_NVMC_READY) == 0)
if(target_check_error(target))
if (target_check_error(target))
return -1;
/* Lock */
@ -566,7 +566,8 @@ static bool samd_cmd_erase_all(target *t)
{
/* Clear the DSU status bits */
target_mem_write32(t, SAMD_DSU_CTRLSTAT,
(SAMD_STATUSA_DONE | SAMD_STATUSA_PERR | SAMD_STATUSA_FAIL));
SAMD_STATUSA_DONE | SAMD_STATUSA_PERR |
SAMD_STATUSA_FAIL);
/* Erase all */
target_mem_write32(t, SAMD_DSU_CTRLSTAT, SAMD_CTRL_CHIP_ERASE);
@ -575,7 +576,7 @@ static bool samd_cmd_erase_all(target *t)
uint32_t status;
while (((status = target_mem_read32(t, SAMD_DSU_CTRLSTAT)) &
(SAMD_STATUSA_DONE | SAMD_STATUSA_PERR | SAMD_STATUSA_FAIL)) == 0)
if(target_check_error(t))
if (target_check_error(t))
return false;
/* Test the protection error bit in Status A */
@ -617,7 +618,7 @@ static bool samd_set_flashlock(target *t, uint16_t value)
/* Poll for NVM Ready */
while ((target_mem_read32(t, SAMD_NVMC_INTFLAG) & SAMD_NVMC_READY) == 0)
if(target_check_error(t))
if (target_check_error(t))
return -1;
/* Modify the high byte of the user row */
@ -633,14 +634,17 @@ static bool samd_set_flashlock(target *t, uint16_t value)
return true;
}
static bool samd_cmd_lock_flash(target *t)
{
return samd_set_flashlock(t, 0x0000);
}
static bool samd_cmd_unlock_flash(target *t)
{
return samd_set_flashlock(t, 0xFFFF);
}
static bool samd_cmd_read_userrow(target *t)
{
gdb_outf("User Row: 0x%08x%08x\n",
@ -649,6 +653,7 @@ static bool samd_cmd_read_userrow(target *t)
return true;
}
/**
* Reads the 128-bit serial number from the NVM
*/
@ -664,6 +669,7 @@ static bool samd_cmd_serial(target *t)
return true;
}
/**
* Returns the size (in bytes) of the current SAM D20's flash memory.
*/
@ -678,6 +684,7 @@ static uint32_t samd_flash_size(target *t)
/* Shift the maximum flash size (256KB) down as appropriate */
return (0x40000 >> (devsel % 5));
}
/**
* Runs the Memory Built In Self Test (MBIST)
*/
@ -697,7 +704,7 @@ static bool samd_cmd_mbist(target *t)
uint32_t status;
while (((status = target_mem_read32(t, SAMD_DSU_CTRLSTAT)) &
(SAMD_STATUSA_DONE | SAMD_STATUSA_PERR | SAMD_STATUSA_FAIL)) == 0)
if(target_check_error(t))
if (target_check_error(t))
return false;
/* Test the protection error bit in Status A */
@ -727,7 +734,7 @@ static bool samd_cmd_ssb(target *t)
/* Poll for NVM Ready */
while ((target_mem_read32(t, SAMD_NVMC_INTFLAG) & SAMD_NVMC_READY) == 0)
if(target_check_error(t))
if (target_check_error(t))
return -1;
gdb_outf("Set the security bit! "
@ -735,3 +742,4 @@ static bool samd_cmd_ssb(target *t)
return true;
}