Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 832:63cce2e2ae20
NEW: Logbook shows markers with small orange boxes in the profile
author | heinrichsweikamp |
---|---|
date | Sun, 10 Jan 2016 11:38:35 +0100 |
parents | 2a0e5d884fc3 |
children |
comparison
equal
deleted
inserted
replaced
831:0cf00ecf3532 | 832:63cce2e2ae20 |
---|---|
809 movff apnoe_mins,xC+1 | 809 movff apnoe_mins,xC+1 |
810 call profile_display_fill ; In this column between this row (xC+0) and the last row (xC+1) | 810 call profile_display_fill ; In this column between this row (xC+0) and the last row (xC+1) |
811 movff xC+0,apnoe_mins ; Store last row for fill routine | 811 movff xC+0,apnoe_mins ; Store last row for fill routine |
812 PIXEL_WRITE timeout_counter3,xC+0 ; Set col(0..159) x row (0..239), put a std color pixel. | 812 PIXEL_WRITE timeout_counter3,xC+0 ; Set col(0..159) x row (0..239), put a std color pixel. |
813 | 813 |
814 incf timeout_counter3,F | 814 incf timeout_counter3,F ; Next column |
815 | 815 ;---- Draw Marker square , if any ---------------------------------------- |
816 btfss log_marker_found ; Any marker to draw? | |
817 bra profile_display_skip_marker ; No | |
818 | |
819 ; 2x2 square | |
820 incf apnoe_mins,W | |
821 movff WREG,win_top | |
822 movlw .4 | |
823 movff WREG,win_height | |
824 movlw .2 | |
825 movff WREG,win_width | |
826 decf timeout_counter3,W | |
827 movff WREG,win_leftx2 | |
828 | |
829 movlw color_orange | |
830 call DISP_set_color | |
831 call DISP_box ; Draw 2x2 Box | |
832 bcf log_marker_found ; Clear flag | |
833 | |
834 profile_display_skip_marker: | |
816 ;---- Draw CNS curve, if any --------------------------------------------- | 835 ;---- Draw CNS curve, if any --------------------------------------------- |
817 movf divisor_cns,W | 836 movf divisor_cns,W |
818 bz profile_display_skip_cns | 837 bz profile_display_skip_cns |
819 ; | 838 ; |
820 ; TODO HERE | 839 ; TODO HERE |
1251 call I2CREAD2 ; read first depth | 1270 call I2CREAD2 ; read first depth |
1252 movff SSPBUF,logbook_cur_depth+0 ; low value | 1271 movff SSPBUF,logbook_cur_depth+0 ; low value |
1253 call I2CREAD2 ; read first depth | 1272 call I2CREAD2 ; read first depth |
1254 movff SSPBUF,logbook_cur_depth+1 ; high value | 1273 movff SSPBUF,logbook_cur_depth+1 ; high value |
1255 call I2CREAD2 ; read Profile Flag Byte | 1274 call I2CREAD2 ; read Profile Flag Byte |
1256 movff SSPBUF,timeout_counter2 ; Read Profile Flag Byte | 1275 movff SSPBUF,timeout_counter2 ; store Profile Flag Byte |
1257 | 1276 |
1258 bcf event_occured ; clear flag | 1277 bcf event_occured ; clear flag |
1259 btfsc timeout_counter2,7 | 1278 btfsc timeout_counter2,7 |
1260 bsf event_occured ; We also have an Event byte! | 1279 bsf event_occured ; We also have an Event byte! |
1261 bcf timeout_counter2,7 ; Clear Event Byte Flag (If any) | 1280 bcf timeout_counter2,7 ; Clear Event Byte Flag (If any) |
1354 rcall profile_display_color ; Back to normal profile color. | 1373 rcall profile_display_color ; Back to normal profile color. |
1355 call I2CREAD2 ; Read O2 | 1374 call I2CREAD2 ; Read O2 |
1356 decf timeout_counter2,F ; reduce counter | 1375 decf timeout_counter2,F ; reduce counter |
1357 call I2CREAD2 ; Read He | 1376 call I2CREAD2 ; Read He |
1358 decf timeout_counter2,F ; reduce counter | 1377 decf timeout_counter2,F ; reduce counter |
1378 ; Any Alarm? | |
1379 bcf EventByte,4 ; Clear bits already tested | |
1380 bcf EventByte,5 | |
1381 bcf EventByte,6 | |
1382 movlw .6 ; manual marker? | |
1383 cpfseq EventByte | |
1384 return ; No, return | |
1385 bsf log_marker_found ; Manual marker! Draw small orange rectancle here | |
1359 return | 1386 return |
1360 | 1387 |
1361 logbook_event2: ; Bailout | 1388 logbook_event2: ; Bailout |
1362 bsf is_bailout ; Set flag | 1389 bsf is_bailout ; Set flag |
1363 movff average_depth_hold_total+3,total_divetime_seconds+0 ; Backup last gas color in case we return to CCR | 1390 movff average_depth_hold_total+3,total_divetime_seconds+0 ; Backup last gas color in case we return to CCR |