summaryrefslogtreecommitdiff
path: root/src/flash/at91sam7.c
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:54 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:54 +0000
commit84df52f9ea78e2d71bde648a16b69d80404c6421 (patch)
tree93c683e2ec71d33978585da29c4bcaa73fd37222 /src/flash/at91sam7.c
parent3813fda44adcea486b7308423a699f63d79273ee (diff)
downloadopenocd+libswd-84df52f9ea78e2d71bde648a16b69d80404c6421.tar.gz
openocd+libswd-84df52f9ea78e2d71bde648a16b69d80404c6421.tar.bz2
openocd+libswd-84df52f9ea78e2d71bde648a16b69d80404c6421.tar.xz
openocd+libswd-84df52f9ea78e2d71bde648a16b69d80404c6421.zip
- Fixes '=' whitespace
- Replace ')\(=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(=\)(' with '\1 \2 ('. - Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/at91sam7.c')
-rw-r--r--src/flash/at91sam7.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c
index 8b51b95b..6fb3440d 100644
--- a/src/flash/at91sam7.c
+++ b/src/flash/at91sam7.c
@@ -232,10 +232,10 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode)
if (fmcn > 0xFF)
fmcn = 0xFF;
- /* Only allow fmcn=0 if clock period is > 30 us = 33kHz. */
+ /* Only allow fmcn = 0 if clock period is > 30 us = 33kHz. */
if (at91sam7_info->mck_freq <= 33333ul)
fmcn = 0;
- /* Only allow fws=0 if clock frequency is < 30 MHz. */
+ /* Only allow fws = 0 if clock frequency is < 30 MHz. */
if (at91sam7_info->mck_freq > 30000000ul)
fws = 1;
@@ -550,7 +550,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* calculate bank size */
bank_size = sectors_num * pages_per_sector * page_size;
- for (bnk=0; bnk<banks_num; bnk++)
+ for (bnk = 0; bnk<banks_num; bnk++)
{
if (bnk > 0)
{
@@ -575,7 +575,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* allocate sectors */
t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
- for (sec=0; sec<sectors_num; sec++)
+ for (sec = 0; sec<sectors_num; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
@@ -639,7 +639,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
fast_check = 1;
- for (nSector=0; nSector<bank->num_sectors; nSector++)
+ for (nSector = 0; nSector<bank->num_sectors; nSector++)
{
retval = target_blank_check_memory(target, bank->base+bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank);
@@ -662,7 +662,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
LOG_USER("Running slow fallback erase check - add working memory");
buffer = malloc(bank->sectors[0].size);
- for (nSector=0; nSector<bank->num_sectors; nSector++)
+ for (nSector = 0; nSector<bank->num_sectors; nSector++)
{
bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base+bank->sectors[nSector].offset, 4,
@@ -670,7 +670,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
if (retval != ERROR_OK)
return retval;
- for (nByte=0; nByte<bank->sectors[nSector].size; nByte++)
+ for (nByte = 0; nByte<bank->sectors[nSector].size; nByte++)
{
if (buffer[nByte] != 0xFF)
{
@@ -705,7 +705,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0;
- for (lock_pos=0; lock_pos<bank->num_sectors; lock_pos++)
+ for (lock_pos = 0; lock_pos<bank->num_sectors; lock_pos++)
{
if ( ((status >> (16+lock_pos))&(0x0001)) == 1)
{
@@ -723,7 +723,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0;
- for (gpnvm_pos=0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
+ for (gpnvm_pos = 0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
{
if ( ((status >> (8+gpnvm_pos))&(0x01)) == 1)
{
@@ -809,7 +809,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* calculate bank size */
bank_size = num_sectors * pages_per_sector * page_size;
- for (bnk=0; bnk<banks_num; bnk++)
+ for (bnk = 0; bnk<banks_num; bnk++)
{
if (bnk > 0)
{
@@ -834,7 +834,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* allocate sectors */
t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
- for (sec=0; sec<num_sectors; sec++)
+ for (sec = 0; sec<num_sectors; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
@@ -902,7 +902,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
/* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(uint8_t));
- for (pos=0; pos<nbytes; pos++)
+ for (pos = 0; pos<nbytes; pos++)
{
buffer[pos] = 0xFF;
}
@@ -916,7 +916,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
}
/* mark erased sectors */
- for (sec=first; sec <= last; sec++)
+ for (sec = first; sec <= last; sec++)
{
bank->sectors[sec].is_erased = 1;
}
@@ -952,7 +952,7 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int l
at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_NVBITS);
- for (sector=first; sector <= last; sector++)
+ for (sector = first; sector <= last; sector++)
{
if (set)
cmd = SLB;
@@ -1016,7 +1016,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o
at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
- for (pagen=first_page; pagen<last_page; pagen++)
+ for (pagen = first_page; pagen<last_page; pagen++)
{
if (bytes_remaining<dst_min_alignment)
count = bytes_remaining;