Mercurial > flash_v2
comparison packages/devs/flash/intel/strata/current/src/flash_program_buf.c @ 163:0d2b193a635f
Merge from eCos master repository on 2001-06-22-17:38:39-BST
| author | jlarmour |
|---|---|
| date | Fri, 22 Jun 2001 18:18:44 +0000 |
| parents | b939e9cada46 |
| children | 42f843b391aa |
comparison
equal
deleted
inserted
replaced
| 162:2395031e7a66 | 163:0d2b193a635f |
|---|---|
| 94 } | 94 } |
| 95 *BA = FLASH_Write_Buffer; | 95 *BA = FLASH_Write_Buffer; |
| 96 } | 96 } |
| 97 *BA = FLASHWORD(wc-1); // Count is 0..N-1 | 97 *BA = FLASHWORD(wc-1); // Count is 0..N-1 |
| 98 for (i = 0; i < wc; i++) { | 98 for (i = 0; i < wc; i++) { |
| 99 *addr++ = *data++; | 99 *(addr+i) = *(data+i); |
| 100 } | 100 } |
| 101 *BA = FLASH_Confirm; | 101 *BA = FLASH_Confirm; |
| 102 | 102 |
| 103 ROM[0] = FLASH_Read_Status; | 103 ROM[0] = FLASH_Read_Status; |
| 104 timeout = 5000000; | 104 timeout = 5000000; |
| 105 while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { | 105 while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { |
| 106 if (--timeout == 0) { | 106 if (--timeout == 0) { |
| 107 goto bad; | |
| 108 } | |
| 109 } | |
| 110 // Jump out if there was an error | |
| 111 if (stat & FLASH_ErrorMask) { | |
| 112 goto bad; | |
| 113 } | |
| 114 // And verify the data - also increments the pointers. | |
| 115 *BA = FLASH_Reset; | |
| 116 for (i = 0; i < wc; i++) { | |
| 117 if ( *addr++ != *data++ ) { | |
| 118 stat = FLASH_ErrorNotVerified; | |
| 107 goto bad; | 119 goto bad; |
| 108 } | 120 } |
| 109 } | 121 } |
| 110 } | 122 } |
| 111 #endif | 123 #endif |
