Mercurial > public > ostc4
comparison Discovery/Src/tInfoLog.c @ 469:04d94851cd1b Improve_Logtansfer
Removed no longer needed reset profile function:
The function was used to mark a profile as invalid. It has been replaced by a comparison between sample and header profile length values.
author | ideenmodellierer |
---|---|
date | Tue, 14 Apr 2020 19:45:34 +0200 |
parents | 4bd01f48c285 |
children | 1f557e5f4b5a |
comparison
equal
deleted
inserted
replaced
468:aa1d71875e25 | 469:04d94851cd1b |
---|---|
64 void showLog(void); | 64 void showLog(void); |
65 void showNextLogPage(void); | 65 void showNextLogPage(void); |
66 void stepBackInfo(void); | 66 void stepBackInfo(void); |
67 void stepForwardInfo(void); | 67 void stepForwardInfo(void); |
68 void showLogExit(void); | 68 void showLogExit(void); |
69 #ifdef ENABLE_PROFILE_RESET | |
70 void resetDiveProfile(void); | |
71 #endif | |
72 | 69 |
73 /* Exported functions --------------------------------------------------------*/ | 70 /* Exported functions --------------------------------------------------------*/ |
74 void tInfoLog_init(void) | 71 void tInfoLog_init(void) |
75 { | 72 { |
76 INFOLOGscreen.FBStartAdress = 0; | 73 INFOLOGscreen.FBStartAdress = 0; |
179 void sendActionToInfoLogShow(uint8_t sendAction) | 176 void sendActionToInfoLogShow(uint8_t sendAction) |
180 { | 177 { |
181 switch(sendAction) | 178 switch(sendAction) |
182 { | 179 { |
183 case ACTION_BUTTON_ENTER: | 180 case ACTION_BUTTON_ENTER: |
184 #ifdef ENABLE_PROFILE_RESET | |
185 resetDiveProfile(); | |
186 #endif | |
187 break; | 181 break; |
188 case ACTION_BUTTON_NEXT: | 182 case ACTION_BUTTON_NEXT: |
189 showNextLogPage(); | 183 showNextLogPage(); |
190 break; | 184 break; |
191 case ACTION_TIMEOUT: | 185 case ACTION_TIMEOUT: |
435 stepBack = (6 * (infolog.page - 1)) + infolog.line - 1; | 429 stepBack = (6 * (infolog.page - 1)) + infolog.line - 1; |
436 //build_logbook_test(); | 430 //build_logbook_test(); |
437 show_logbook_test(0, stepBack); | 431 show_logbook_test(0, stepBack); |
438 } | 432 } |
439 | 433 |
440 #ifdef ENABLE_PROFILE_RESET | |
441 void resetDiveProfile() | |
442 { | |
443 uint8_t stepBack; | |
444 SLogbookHeader logbookHeader; | |
445 convert_Type dataStart; | |
446 stepBack = (6 * (infolog.page - 1)) + infolog.line - 1; /* calculate current dive ID */ | |
447 logbook_getHeader(stepBack ,&logbookHeader); | |
448 | |
449 dataStart.u8bit.byteHigh = 0; | |
450 dataStart.u8bit.byteLow = logbookHeader.pBeginProfileData[0]; | |
451 dataStart.u8bit.byteMidLow = logbookHeader.pBeginProfileData[1]; | |
452 dataStart.u8bit.byteMidHigh = logbookHeader.pBeginProfileData[2]; | |
453 | |
454 dataStart.u32bit &= 0xFFFF0000; /* set to sector start */ | |
455 ext_flash_invalidate_sample_index(dataStart.u32bit); | |
456 } | |
457 #endif |