comparison src/logbook.asm @ 376:e99bb91f6f92

CHANGE: Do not show ppO2 in warning area if already shown in custom view BUGFIX: Logbook list view for more then 100 stored dives
author heinrichsweikamp
date Mon, 07 Sep 2015 13:58:23 +0200
parents f8adb2d5d328
children 9175429bdeba
comparison
equal deleted inserted replaced
375:a9e35c1327aa 376:e99bb91f6f92
465 movff temp1,lo 465 movff temp1,lo
466 call ext_flash_byte_read_plus ; Minutes 466 call ext_flash_byte_read_plus ; Minutes
467 movf lo,W 467 movf lo,W
468 mullw .60 468 mullw .60
469 movff temp1,WREG 469 movff temp1,WREG
470 addwf PRODL,F 470 infsnz PRODL,F
471 movlw .0 471 incf PRODH,F ; PRODH:PRODL has end-of-dive time in minutes
472 addwfc PRODH,F ; PRODH:PRODL has end-of-dive time in minutes
473 472
474 ; TODO: Fix entry time when dive was during midnight 473 ; TODO: Fix entry time when dive was during midnight
475 LOG_POINT_TO log_total_seconds 474 LOG_POINT_TO log_total_seconds
476 call ext_flash_byte_read_plus ; Total sample time in seconds 475 call ext_flash_byte_read_plus ; Total sample time in seconds
477 movff temp1,lo 476 movff temp1,lo
506 movwf xB+0 505 movwf xB+0
507 clrf xB+1 506 clrf xB+1
508 call div16x16 ; does xA/xB=xC 507 call div16x16 ; does xA/xB=xC
509 movff xC+0,y_scale+0 ; holds LOW byte of y-scale (mbar/pixel!) 508 movff xC+0,y_scale+0 ; holds LOW byte of y-scale (mbar/pixel!)
510 movff xC+1,y_scale+1 ; holds HIGH byte of y-scale (mbar/pixel!) 509 movff xC+1,y_scale+1 ; holds HIGH byte of y-scale (mbar/pixel!)
511 incf y_scale+0,F ; increase one, because there may be a remainder 510 infsnz y_scale+0,F ; increase one, because there may be a remainder
512 movlw d'0' 511 incf y_scale+1,F
513 addwfc y_scale+1,F
514 512
515 movlw LOW ((profile_height_pixels+1)*.1000) 513 movlw LOW ((profile_height_pixels+1)*.1000)
516 movwf xC+0 514 movwf xC+0
517 movlw HIGH (((profile_height_pixels+1)*.1000) & h'FFFF') 515 movlw HIGH (((profile_height_pixels+1)*.1000) & h'FFFF')
518 movwf xC+1 516 movwf xC+1
601 movwf xB+0 599 movwf xB+0
602 clrf xB+1 600 clrf xB+1
603 call div16x16 ; xA/xB=xC 601 call div16x16 ; xA/xB=xC
604 movff xC+0,profile_temp+0 ; store value (use any #xC sample, skip xC-1) into temp registers 602 movff xC+0,profile_temp+0 ; store value (use any #xC sample, skip xC-1) into temp registers
605 movff xC+1,profile_temp+1 ; store value (use any #xC sample, skip xC-1) into temp registers 603 movff xC+1,profile_temp+1 ; store value (use any #xC sample, skip xC-1) into temp registers
606 incf profile_temp+0,F ; Increase by one, there might be a remainder 604 infsnz profile_temp+0,F ; Increase by one, there might be a remainder
607 movlw d'0' 605 incf profile_temp+1,F
608 addwfc profile_temp+1,F
609 606
610 bsf leftbind 607 bsf leftbind
611 output_99x ; divetime seconds 608 output_99x ; divetime seconds
612 call TFT_standard_color 609 call TFT_standard_color
613 STRCAT_PRINT "" 610 STRCAT_PRINT ""
1215 1212
1216 ;============================================================================= 1213 ;=============================================================================
1217 1214
1218 1215
1219 profile_view_get_depth: 1216 profile_view_get_depth:
1220 incf logbook_sample_counter+0,F 1217 infsnz logbook_sample_counter+0,F
1221 movlw d'0' 1218 incf logbook_sample_counter+1,F ; Count read pixels
1222 addwfc logbook_sample_counter+1,F ; Count read pixels
1223 1219
1224 movf logbook_sample_counter+0,W 1220 movf logbook_sample_counter+0,W
1225 cpfseq average_depth_hold_total+0 1221 cpfseq average_depth_hold_total+0
1226 bra profile_view_get_depth_no_line ; no need to draw a 10min line, continue 1222 bra profile_view_get_depth_no_line ; no need to draw a 10min line, continue
1227 movf logbook_sample_counter+1,W 1223 movf logbook_sample_counter+1,W
1504 call ext_flash_byte_read_plus 1500 call ext_flash_byte_read_plus
1505 movff temp1,lo ; read divetime minutes 1501 movff temp1,lo ; read divetime minutes
1506 call ext_flash_byte_read_plus 1502 call ext_flash_byte_read_plus
1507 movff temp1,hi 1503 movff temp1,hi
1508 output_16_3 ; Divetime minutes (0-999min) 1504 output_16_3 ; Divetime minutes (0-999min)
1509 STRCAT_TEXT_PRINT tMinutes ; Display header-row in list 1505 STRCAT_TEXT tMinutes
1506 clrf WREG
1507 movff WREG,buffer+.20 ; limit to 20 chars
1508 STRCAT_PRINT "" ; Display header-row in list
1510 return 1509 return
1511 1510
1512 logbook_show_divenumber: 1511 logbook_show_divenumber:
1513 call do_logoffset_common_read ; Read into lo:hi 1512 call do_logoffset_common_read ; Read into lo:hi
1514 tstfsz lo ; lo=0? 1513 tstfsz lo ; lo=0?
1517 bra logbook_show_divenumber2 ; No, adjust offset 1516 bra logbook_show_divenumber2 ; No, adjust offset
1518 movff divesecs,lo ; lo=0 and hi=0 -> skip Offset routine 1517 movff divesecs,lo ; lo=0 and hi=0 -> skip Offset routine
1519 bra logbook_show_divenumber3 ; Display now 1518 bra logbook_show_divenumber3 ; Display now
1520 1519
1521 logbook_show_divenumber2: 1520 logbook_show_divenumber2:
1522 movlw d'1' 1521 infsnz lo,F
1523 addwf lo,F 1522 incf hi,F ; hi:lo = hi:lo + 1
1524 movlw d'0'
1525 addwfc hi,F ; hi:lo = hi:lo + 1
1526 movff lo,sub_a+0 1523 movff lo,sub_a+0
1527 movff hi,sub_a+1 1524 movff hi,sub_a+1
1528 movff divesecs,sub_b+0 1525 movff divesecs,sub_b+0
1529 clrf sub_b+1 1526 clrf sub_b+1
1530 call subU16 ; sub_c = sub_a - sub_b 1527 call subU16 ; sub_c = sub_a - sub_b