summaryrefslogtreecommitdiff
path: root/src/flash/ocl/at91sam7x/main.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/ocl/at91sam7x/main.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/ocl/at91sam7x/main.c')
-rw-r--r--src/flash/ocl/at91sam7x/main.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/flash/ocl/at91sam7x/main.c b/src/flash/ocl/at91sam7x/main.c
index b49a5b89..c65a171d 100644
--- a/src/flash/ocl/at91sam7x/main.c
+++ b/src/flash/ocl/at91sam7x/main.c
@@ -39,19 +39,19 @@ void cmd_flash(uint32 cmd)
int pagenum;
int result;
- adr=dcc_rd();
- len=cmd&0xffff;
- ofs=adr%flash_page_size;
- bi_start=ofs/4;
- bi_end=(ofs+len+3)/4;
+ adr = dcc_rd();
+ len = cmd&0xffff;
+ ofs = adr%flash_page_size;
+ bi_start = ofs/4;
+ bi_end = (ofs+len+3)/4;
if (bi_end>BUFSIZE) {
dcc_wr(OCL_BUFF_OVER);
return;
}
- chksum=OCL_CHKS_INIT;
- for (bi=0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
+ chksum = OCL_CHKS_INIT;
+ for (bi = 0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
if (dcc_rd() != chksum) {
dcc_wr(OCL_CHKS_FAIL);
@@ -59,18 +59,18 @@ void cmd_flash(uint32 cmd)
}
/* fill in unused positions with unprogrammed values */
- for (bi=0; bi<bi_start; bi++) buffer[bi]=0xffffffff;
- for (bi=bi_end; bi%flash_page_size; bi++) buffer[bi]=0xffffffff;
+ for (bi = 0; bi<bi_start; bi++) buffer[bi]=0xffffffff;
+ for (bi = bi_end; bi%flash_page_size; bi++) buffer[bi]=0xffffffff;
- result=0;
- pagenum=adr/flash_page_size;
- for (bi=0; bi<bi_end; bi += flash_page_size/4) {
- result=flash_page_program(buffer+bi, pagenum++);
+ result = 0;
+ pagenum = adr/flash_page_size;
+ for (bi = 0; bi<bi_end; bi += flash_page_size/4) {
+ result = flash_page_program(buffer+bi, pagenum++);
if (result) break;
}
/* verify written data */
- if (!result) result=flash_verify(adr, len, ((uint8 *)buffer)+ofs);
+ if (!result) result = flash_verify(adr, len, ((uint8 *)buffer)+ofs);
dcc_wr(OCL_CMD_DONE|result);
}
@@ -81,7 +81,7 @@ int main (void)
uint32 cmd;
for (;;) {
- cmd=dcc_rd();
+ cmd = dcc_rd();
switch (cmd&OCL_CMD_MASK) {
case OCL_PROBE:
dcc_wr(OCL_CMD_DONE|flash_init());