Mercurial > public > hwos_code
comparison src/logbook.asm @ 389:9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
CHANGE: Logbook shows start-of-dive date and time for dives made with firmware >=1.92
BUGFIX: Text alignment in logbook
author | heinrichsweikamp |
---|---|
date | Tue, 27 Oct 2015 13:45:10 +0100 |
parents | e99bb91f6f92 |
children | 32780516c8c6 |
comparison
equal
deleted
inserted
replaced
388:d8e2cf055fc3 | 389:9175429bdeba |
---|---|
85 #DEFINE logbook_divenumer_row .1 | 85 #DEFINE logbook_divenumer_row .1 |
86 ; Date and Time | 86 ; Date and Time |
87 #DEFINE logbook_date_column .100 | 87 #DEFINE logbook_date_column .100 |
88 #DEFINE logbook_date_row .7 | 88 #DEFINE logbook_date_row .7 |
89 #DEFINE logbook_time_column .120 | 89 #DEFINE logbook_time_column .120 |
90 #DEFINE logbook_time_row .33 | 90 #DEFINE logbook_time_row .38 |
91 ; Max. Depth | 91 ; Max. Depth |
92 #DEFINE log_max_value_row .38 | 92 #DEFINE log_max_value_row .38 |
93 #DEFINE log_max_value_column .1 | 93 #DEFINE log_max_value_column .1 |
94 ; Divetime | 94 ; Divetime |
95 #DEFINE log_divetime_value_row .38 | 95 #DEFINE log_divetime_value_row .38 |
146 #DEFINE MBAR_row .10*.16+log2_salinity_row | 146 #DEFINE MBAR_row .10*.16+log2_salinity_row |
147 #DEFINE MBAR_column log2_salinity_column | 147 #DEFINE MBAR_column log2_salinity_column |
148 | 148 |
149 | 149 |
150 ; Header coordinates | 150 ; Header coordinates |
151 #DEFINE log_profile_version .8 | |
151 #DEFINE log_date .12 | 152 #DEFINE log_date .12 |
152 #DEFINE log_time .15 | 153 #DEFINE log_time .15 |
153 #DEFINE log_max_depth .17 | 154 #DEFINE log_max_depth .17 |
154 #DEFINE log_divetime .19 | 155 #DEFINE log_divetime .19 |
155 #DEFINE log_min_temp .22 | 156 #DEFINE log_min_temp .22 |
462 | 463 |
463 WIN_SMALL logbook_time_column, logbook_time_row | 464 WIN_SMALL logbook_time_column, logbook_time_row |
464 call ext_flash_byte_read_plus ; hour | 465 call ext_flash_byte_read_plus ; hour |
465 movff temp1,lo | 466 movff temp1,lo |
466 call ext_flash_byte_read_plus ; Minutes | 467 call ext_flash_byte_read_plus ; Minutes |
467 movf lo,W | |
468 mullw .60 | |
469 movff temp1,WREG | |
470 infsnz PRODL,F | |
471 incf PRODH,F ; PRODH:PRODL has end-of-dive time in minutes | |
472 | |
473 ; TODO: Fix entry time when dive was during midnight | |
474 LOG_POINT_TO log_total_seconds | |
475 call ext_flash_byte_read_plus ; Total sample time in seconds | |
476 movff temp1,lo | |
477 call ext_flash_byte_read_plus ; Total sample time in seconds | |
478 movff temp1,hi | 468 movff temp1,hi |
479 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo) | |
480 clrf sub_b+1 | |
481 movff hi,sub_b+0 | |
482 movff PRODL,sub_a+0 | |
483 movff PRODH,sub_a+1 | |
484 call subU16 ; sub_c = sub_a - sub_b (with UNSIGNED values) | |
485 ; sub_c:2 holds entry time in minutes | |
486 movff sub_c+0,lo | |
487 movff sub_c+1,hi | |
488 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
489 movff lo,PRODL ; temp | |
490 movff hi,lo | |
491 output_99x ; hour | 469 output_99x ; hour |
492 PUTC ':' | 470 PUTC ':' |
493 movff PRODL,lo | 471 movff hi,lo |
494 output_99x ; minute | 472 output_99x ; minute |
495 STRCAT_PRINT "" ; Display 1st row of details | 473 STRCAT_PRINT "" ; Display 1st row of details |
496 | 474 |
475 LOG_POINT_TO log_profile_version | |
476 call ext_flash_byte_read_plus ; Profile version | |
477 movlw 0x24 | |
478 cpfslt temp1 ; <0x24? | |
479 bra log_skip_extra_icon ; Yes, skip | |
480 | |
481 WIN_SMALL logbook_time_column-.8, logbook_time_row | |
482 STRCPY_PRINT 0x94 ; "End of dive" icon | |
483 | |
484 log_skip_extra_icon: | |
497 LOG_POINT_TO log_max_depth | 485 LOG_POINT_TO log_max_depth |
498 call ext_flash_byte_read_plus ; read max depth | 486 call ext_flash_byte_read_plus ; read max depth |
499 movff temp1,lo | 487 movff temp1,lo |
500 call ext_flash_byte_read_plus ; read max depth | 488 call ext_flash_byte_read_plus ; read max depth |
501 movff temp1,hi | 489 movff temp1,hi |