comparison Discovery/Src/externLogbookFlash.c @ 282:c7e665e0b08f

translate some comments into english
author heinrichsweikamp
date Wed, 01 May 2019 14:45:47 +0200
parents 1b9847d40e81
children 2174fb133dbe
comparison
equal deleted inserted replaced
281:54d14bc2083c 282:c7e665e0b08f
1021 if(startNumber == 0) 1021 if(startNumber == 0)
1022 return 0; 1022 return 0;
1023 1023
1024 actualNumber = startNumber - 1; 1024 actualNumber = startNumber - 1;
1025 1025
1026 // wo ist der �lteste Tauchgang (der, der startNumber bekommt) 1026 // where is the oldest dive (Which is now getting startNumber)
1027 // use first header for ease (without HEADER2OFFSET for end of dive header) 1027 // use first header for ease (without HEADER2OFFSET for end of dive header)
1028 // compare for lastLogId to prevent endless loop 1028 // compare for lastLogId to prevent endless loop
1029 1029
1030 if(*(uint16_t*)&data[lastLogId * headerStep] != 0xFAFA) 1030 if(*(uint16_t*)&data[lastLogId * headerStep] != 0xFAFA)
1031 return 0; 1031 return 0;
1059 1059
1060 // =============================================================================== 1060 // ===============================================================================
1061 // ext_flash_repair_SPECIAL_dive_numbers_starting_count_with 1061 // ext_flash_repair_SPECIAL_dive_numbers_starting_count_with
1062 /// @brief This function 1062 /// @brief This function
1063 /// @date 04-April-2016 1063 /// @date 04-April-2016
1064 /// problem (160621): 64K Bl�cke (32 Tauchg�nge) weil neuer Flash Chip. 1064 /// problem (160621): 64K blocks (32 dives) in the new flash memory chip
1065 /// Dieser Bereich muss auf einmal gel�scht werden. 1065 /// This block needs to be deleted
1066 /// Vorher waren es 4K Bl�cke. 1066 /// these where only 4KB block before
1067 /// @output endCount, last diveNumber 1067 /// @output endCount, last diveNumber
1068 1068
1069 // =============================================================================== 1069 // ===============================================================================
1070 uint16_t ext_flash_repair_SPECIAL_dive_numbers_starting_count_with(uint16_t startCount) 1070 uint16_t ext_flash_repair_SPECIAL_dive_numbers_starting_count_with(uint16_t startCount)
1071 { 1071 {
1072 uint32_t logCopyDataPtr = 0; 1072 uint32_t logCopyDataPtr = 0;
1073 uint8_t *data; 1073 uint8_t *data;
1074 uint16_t lastCount; 1074 uint16_t lastCount;
1075 uint8_t listOfChanged64kBlocks[8]; // 32 Tauchg�nge pro 64K 1075 uint8_t listOfChanged64kBlocks[8]; // 32 dives each 64K
1076 1076
1077 logCopyDataPtr = getFrame(97); 1077 logCopyDataPtr = getFrame(97);
1078 data = (uint8_t *)logCopyDataPtr; 1078 data = (uint8_t *)logCopyDataPtr;
1079 1079
1080 for(int i=0;i<8;i++) 1080 for(int i=0;i<8;i++)
1532 write_spi(0x06,RELEASE);/* WREN */ 1532 write_spi(0x06,RELEASE);/* WREN */
1533 write_spi(0x20,HOLDCS);/* sector erase cmd */ 1533 write_spi(0x20,HOLDCS);/* sector erase cmd */
1534 write_address(RELEASE); 1534 write_address(RELEASE);
1535 } 1535 }
1536 1536
1537 /* be carefull - might not work with entire family and other products 1537 /* be careful - might not work with entire family and other products
1538 * see page 14 of LOGBOOK_V3_S25FS-S_00-271247.pdf 1538 * see page 14 of LOGBOOK_V3_S25FS-S_00-271247.pdf
1539 */ 1539 */
1540 static void ext_flash_erase32kB(void) 1540 static void ext_flash_erase32kB(void)
1541 { 1541 {
1542 uint32_t actualAddress_backup; 1542 uint32_t actualAddress_backup;