Mercurial > public > hwos_code
comparison src/logbook.asm @ 402:a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
Slightly reduce max. backlight levels
author | heinrichsweikamp |
---|---|
date | Sun, 10 Jan 2016 09:36:47 +0100 |
parents | 32780516c8c6 |
children | e5a9c9f76315 |
comparison
equal
deleted
inserted
replaced
401:7be43d886bb1 | 402:a3a0f1fd7fc4 |
---|---|
61 #DEFINE return_from_profileview logbook_flags,0 | 61 #DEFINE return_from_profileview logbook_flags,0 |
62 #DEFINE all_dives_shown logbook_flags,1 | 62 #DEFINE all_dives_shown logbook_flags,1 |
63 #DEFINE logbook_page_not_empty logbook_flags,2 | 63 #DEFINE logbook_page_not_empty logbook_flags,2 |
64 #DEFINE end_of_profile logbook_flags,3 | 64 #DEFINE end_of_profile logbook_flags,3 |
65 #DEFINE keep_cursor_new_page logbook_flags,4 | 65 #DEFINE keep_cursor_new_page logbook_flags,4 |
66 #DEFINE log_marker_found logbook_flags,5 | |
66 | 67 |
67 | 68 |
68 ; Logbook Coordinates | 69 ; Logbook Coordinates |
69 #DEFINE logbook_list_left .10 ; Column of dive# in list | 70 #DEFINE logbook_list_left .10 ; Column of dive# in list |
70 #DEFINE logbook_row_offset .28 ; Distance between rows of list | 71 #DEFINE logbook_row_offset .28 ; Distance between rows of list |
900 movff apnoe_mins,xC+1 | 901 movff apnoe_mins,xC+1 |
901 call profile_display_fill ; In this column between this row (xC+0) and the last row (xC+1) | 902 call profile_display_fill ; In this column between this row (xC+0) and the last row (xC+1) |
902 movff xC+0,apnoe_mins ; Store last row for fill routine | 903 movff xC+0,apnoe_mins ; Store last row for fill routine |
903 | 904 |
904 PIXEL_WRITE logbook_pixel_x_pos,xC+0 ; Set col(0..159) x row (0..239), put a std color pixel. | 905 PIXEL_WRITE logbook_pixel_x_pos,xC+0 ; Set col(0..159) x row (0..239), put a std color pixel. |
905 | 906 incf logbook_pixel_x_pos,F ; Next column |
907 | |
908 ;---- Draw Marker square , if any ---------------------------------------- | |
909 btfss log_marker_found ; Any marker to draw? | |
910 bra profile_display_skip_marker ; No | |
911 | |
912 ; 2x2 square | |
913 incf apnoe_mins,W | |
914 movff WREG,win_top | |
915 movlw .4 | |
916 movff WREG,win_height | |
917 movlw .2 | |
918 movff WREG,win_width | |
919 decf logbook_pixel_x_pos,W | |
920 movff WREG,win_leftx2 | |
921 | |
922 movlw color_orange | |
923 call TFT_set_color | |
924 call TFT_box ; Draw 2x2 Box | |
925 bcf log_marker_found ; Clear flag | |
926 | |
927 profile_display_skip_marker: | |
906 ;---- Draw CNS curve, if any --------------------------------------------- | 928 ;---- Draw CNS curve, if any --------------------------------------------- |
907 movf divisor_cns,W | 929 movf divisor_cns,W |
908 bz profile_display_skip_cns | 930 bz profile_display_skip_cns |
909 ; | 931 ; |
910 ; TODO HERE | 932 ; TODO HERE |
916 bz profile_display_skip_gf | 938 bz profile_display_skip_gf |
917 ; | 939 ; |
918 ; TODO HERE | 940 ; TODO HERE |
919 ; | 941 ; |
920 profile_display_skip_gf: | 942 profile_display_skip_gf: |
921 incf logbook_pixel_x_pos,F ; Next column | |
922 | 943 |
923 ;---- All curves done. | 944 ;---- All curves done. |
924 | 945 |
925 profile_display_skip_loop1: ; skips readings! | 946 profile_display_skip_loop1: ; skips readings! |
926 dcfsnz profile_temp2+0,F | 947 dcfsnz profile_temp2+0,F |
1230 call ext_flash_byte_read_plus_0x20 ; read depth first | 1251 call ext_flash_byte_read_plus_0x20 ; read depth first |
1231 movff temp1,logbook_cur_depth+0 ; low value | 1252 movff temp1,logbook_cur_depth+0 ; low value |
1232 call ext_flash_byte_read_plus_0x20 ; read depth first | 1253 call ext_flash_byte_read_plus_0x20 ; read depth first |
1233 movff temp1,logbook_cur_depth+1 ; high value | 1254 movff temp1,logbook_cur_depth+1 ; high value |
1234 call ext_flash_byte_read_plus_0x20 ; read Profile Flag Byte | 1255 call ext_flash_byte_read_plus_0x20 ; read Profile Flag Byte |
1235 movff temp1,timeout_counter2 ; Read Profile Flag Byte | 1256 movff temp1,timeout_counter2 ; store Profile Flag Byte |
1236 | 1257 |
1237 bcf event_occured ; clear flag | 1258 bcf event_occured ; clear flag |
1238 btfsc timeout_counter2,7 | 1259 btfsc timeout_counter2,7 |
1239 bsf event_occured ; We also have an Event byte! | 1260 bsf event_occured ; We also have an Event byte! |
1240 bcf timeout_counter2,7 ; Clear Event Byte Flag (If any) | 1261 bcf timeout_counter2,7 ; Clear Event Byte Flag (If any) |
1328 rcall logbook_event4 ; Yes! | 1349 rcall logbook_event4 ; Yes! |
1329 btfsc EventByte,6 ; Setpoint Change? | 1350 btfsc EventByte,6 ; Setpoint Change? |
1330 rcall logbook_event3 ; Yes! | 1351 rcall logbook_event3 ; Yes! |
1331 btfsc EventByte2,0 ; Bailout? | 1352 btfsc EventByte2,0 ; Bailout? |
1332 rcall logbook_event2 ; Yes! | 1353 rcall logbook_event2 ; Yes! |
1354 ; Any Alarm? | |
1355 bcf EventByte,4 ; Clear bits already tested | |
1356 bcf EventByte,5 | |
1357 bcf EventByte,6 | |
1358 movlw .6 ; manual marker? | |
1359 cpfseq EventByte | |
1360 return ; No, return | |
1361 bsf log_marker_found ; Manual marker! Draw small yellow rectancle here | |
1333 return | 1362 return |
1334 | 1363 |
1335 logbook_event4: ; Stored Gas changed! | 1364 logbook_event4: ; Stored Gas changed! |
1336 call ext_flash_byte_read_plus_0x20 ; Read Gas# | 1365 call ext_flash_byte_read_plus_0x20 ; Read Gas# |
1337 decf timeout_counter2,F ; reduce counter | 1366 decf timeout_counter2,F ; reduce counter |