Mercurial > public > ostc4
comparison Discovery/Src/externLogbookFlash.c @ 459:7ac0e76dbd6a minor_improvments
Activated reset of sample information within header data at time of sector erasing:
After sample information have been erased the header are pointing to empty storage locations. To redefine the headers the sample addresses will be set to zero incating that no data is available. In that case the dummy functionality implemented by the last commits will be applied
author | ideenmodellierer |
---|---|
date | Sun, 29 Mar 2020 21:39:57 +0200 |
parents | b90ddf57f7f1 |
children | 2effe85f1a9b |
comparison
equal
deleted
inserted
replaced
458:5dd996ed8611 | 459:7ac0e76dbd6a |
---|---|
785 if(actualAddress >= SAMPLESTOP) | 785 if(actualAddress >= SAMPLESTOP) |
786 { | 786 { |
787 actualAddress = SAMPLESTART; | 787 actualAddress = SAMPLESTART; |
788 } | 788 } |
789 preparedPageAddress = actualAddress; | 789 preparedPageAddress = actualAddress; |
790 ext_flash_invalidate_sample_index(preparedPageAddress); | |
790 ext_flash_erase64kB(); | 791 ext_flash_erase64kB(); |
791 actualAddress = actualAdressBackup; | 792 actualAddress = actualAdressBackup; |
792 } | 793 } |
793 } | 794 } |
794 } | 795 } |
1793 /* safety */ | 1794 /* safety */ |
1794 if(actualAddress < ringStart) | 1795 if(actualAddress < ringStart) |
1795 actualAddress = ringStart; | 1796 actualAddress = ringStart; |
1796 | 1797 |
1797 if(do_not_erase == 0) | 1798 if(do_not_erase == 0) |
1798 ext_flash_erase_if_on_page_start(); | 1799 { |
1800 if((ext_flash_erase_if_on_page_start()) && (type == EF_SAMPLE)) /* invalidate header sample information if needed */ | |
1801 { | |
1802 ext_flash_invalidate_sample_index(actualAddress); | |
1803 } | |
1804 } | |
1799 | 1805 |
1800 while( i<length) | 1806 while( i<length) |
1801 { | 1807 { |
1802 ef_hw_rough_delay_us(5); | 1808 ef_hw_rough_delay_us(5); |
1803 wait_chip_not_busy(); | 1809 wait_chip_not_busy(); |
2314 ext_flash_incf_address(EF_HEADER); /* skip header bytes */ | 2320 ext_flash_incf_address(EF_HEADER); /* skip header bytes */ |
2315 ext_flash_incf_address(EF_HEADER); | 2321 ext_flash_incf_address(EF_HEADER); |
2316 actualPointerHeader = actualAddress; | 2322 actualPointerHeader = actualAddress; |
2317 ef_write_block(emptySamples,9,EF_HEADER,1); /* clear start, stop and length data */ | 2323 ef_write_block(emptySamples,9,EF_HEADER,1); /* clear start, stop and length data */ |
2318 actualPointerHeader = HeaderAddrBackup; | 2324 actualPointerHeader = HeaderAddrBackup; |
2319 } | 2325 } |
2320 #if 0 | 2326 } |
2321 else /* no sample part within erased sector => stop search */ | 2327 diveidx++; |
2322 { | 2328 } |
2323 break; | |
2324 } | |
2325 #endif | |
2326 } | |
2327 #if 0 | |
2328 else /* ID not in use => stop search */ | |
2329 { | |
2330 break; | |
2331 } | |
2332 #endif | |
2333 diveidx++; | |
2334 } | |
2335 } | 2329 } |
2336 | 2330 |
2337 | 2331 |
2338 | 2332 |
2339 /* | 2333 /* |