Mercurial > public > hwos_code
comparison src/logbook.asm @ 255:ad62dff7739a
add bearing option to compass
author | heinrichsweikamp |
---|---|
date | Mon, 23 Mar 2015 17:07:57 +0100 |
parents | 31088352ee32 |
children | 653a3ab08062 |
comparison
equal
deleted
inserted
replaced
254:5fe7aff622f3 | 255:ad62dff7739a |
---|---|
192 ;============================================================================= | 192 ;============================================================================= |
193 | 193 |
194 logbook code | 194 logbook code |
195 | 195 |
196 TFT_logbook_cursor: | 196 TFT_logbook_cursor: |
197 call speed_fastest | 197 ; call speed_fastest |
198 WIN_BOX_BLACK .0, .240-.16, logbook_list_left-.16, logbook_list_left-.1 ;top, bottom, left, right | 198 WIN_BOX_BLACK .0, .240-.16, logbook_list_left-.16, logbook_list_left-.1 ;top, bottom, left, right |
199 | 199 |
200 WIN_LEFT logbook_list_left-.16 | 200 WIN_LEFT logbook_list_left-.16 |
201 WIN_FONT FT_SMALL | 201 WIN_FONT FT_SMALL |
202 bcf win_invert ; Reset invert flag | 202 bcf win_invert ; Reset invert flag |
254 ; a) no dive is stored (no valid header found) | 254 ; a) no dive is stored (no valid header found) |
255 ; b) current dive has no valid header (Number of stored dives < 256) | 255 ; b) current dive has no valid header (Number of stored dives < 256) |
256 ; c) when 255 dives are reached divemins+0 = 255 | 256 ; c) when 255 dives are reached divemins+0 = 255 |
257 | 257 |
258 logbook2: | 258 logbook2: |
259 call speed_fastest | 259 ; call speed_fastest |
260 incf divemins+0,F ; increase dive counter | 260 incf divemins+0,F ; increase dive counter |
261 incf divemins+0,W ; = 0x..FF ? | 261 incf divemins+0,W ; = 0x..FF ? |
262 bz logbook_reset ; Yes: FF --> loop. | 262 bz logbook_reset ; Yes: FF --> loop. |
263 | 263 |
264 ; Set ext_flash_address:3 to TOC entry of this dive | 264 ; Set ext_flash_address:3 to TOC entry of this dive |
378 goto next_logbook2 ; Next page! | 378 goto next_logbook2 ; Next page! |
379 | 379 |
380 display_profile: | 380 display_profile: |
381 bcf is_bailout | 381 bcf is_bailout |
382 bcf gas6_changed ; Clear event flags | 382 bcf gas6_changed ; Clear event flags |
383 call speed_fastest | 383 ; call speed_fastest |
384 movff menupos,logbook_menupos_temp; store current cursor position | 384 movff menupos,logbook_menupos_temp; store current cursor position |
385 bsf return_from_profileview ; tweak search routine to exit after found | 385 bsf return_from_profileview ; tweak search routine to exit after found |
386 | 386 |
387 movf logbook_page_number,W ; Number of page | 387 movf logbook_page_number,W ; Number of page |
388 mullw logbook_row_number | 388 mullw logbook_row_number |
389 movf PRODL,W | 389 movf PRODL,W |
390 addwf menupos,W ; page*logbook_row_number+menupos= | 390 addwf menupos,W ; page*logbook_row_number+menupos= |
391 movwf divesecs ; # of dive to show | 391 movwf divesecs ; # of dive to show |
392 | 392 |
393 display_profile2: | 393 display_profile2: |
394 call speed_fastest | 394 ; call speed_fastest |
395 clrf CCP1CON ; stop PWM | 395 clrf CCP1CON ; stop PWM |
396 bcf PORTC,2 ; Pull PWM out to GND | 396 bcf PORTC,2 ; Pull PWM out to GND |
397 call TFT_ClearScreen ; Clear screen | 397 call TFT_ClearScreen ; Clear screen |
398 ; Set ext_flash pointer to "#divesecs-oldest" dive | 398 ; Set ext_flash pointer to "#divesecs-oldest" dive |
399 ; compute read_int_eeprom .2 - divesecs | 399 ; compute read_int_eeprom .2 - divesecs |
1368 movff total_divetime_seconds+0,average_depth_hold_total+3 ; Restore color | 1368 movff total_divetime_seconds+0,average_depth_hold_total+3 ; Restore color |
1369 rcall profile_display_color ; Back to normal profile color. | 1369 rcall profile_display_color ; Back to normal profile color. |
1370 return | 1370 return |
1371 | 1371 |
1372 exit_profileview: | 1372 exit_profileview: |
1373 call speed_fastest | 1373 ; call speed_fastest |
1374 bcf sleepmode | 1374 bcf sleepmode |
1375 clrf timeout_counter2 ; restore all registers to build same page again | 1375 clrf timeout_counter2 ; restore all registers to build same page again |
1376 movff divemins_backup,divemins+0 | 1376 movff divemins_backup,divemins+0 |
1377 movff logbook_divenumber_temp, logbook_divenumber | 1377 movff logbook_divenumber_temp, logbook_divenumber |
1378 movff logbook_max_dive_counter_temp,logbook_max_dive_counter | 1378 movff logbook_max_dive_counter_temp,logbook_max_dive_counter |
1518 STRCAT_PRINT "" | 1518 STRCAT_PRINT "" |
1519 return | 1519 return |
1520 | 1520 |
1521 | 1521 |
1522 logbook_page2: ; Show more info | 1522 logbook_page2: ; Show more info |
1523 call speed_fastest | 1523 ; call speed_fastest |
1524 clrf CCP1CON ; stop PWM | 1524 clrf CCP1CON ; stop PWM |
1525 bcf PORTC,2 ; Pull PWM out to GND | 1525 bcf PORTC,2 ; Pull PWM out to GND |
1526 call TFT_ClearScreen ; Clear screen | 1526 call TFT_ClearScreen ; Clear screen |
1527 | 1527 |
1528 ; Set ext_flash pointer to "#divesecs-oldest" dive | 1528 ; Set ext_flash pointer to "#divesecs-oldest" dive |