comparison src/logbook.asm @ 169:dcf3e08f31ac

CHANGE: Improve internal logbook usability
author heinrichsweikamp
date Mon, 29 Sep 2014 22:26:47 +0200
parents 1784ab9362ca
children e79bc535ef9e
comparison
equal deleted inserted replaced
168:1784ab9362ca 169:dcf3e08f31ac
60 60
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 66
66 67
67 ; Logbook Coordinates 68 ; Logbook Coordinates
68 #DEFINE logbook_list_left .18 ; Column of dive# in list 69 #DEFINE logbook_list_left .18 ; Column of dive# in list
69 #DEFINE logbook_row_offset .28 ; Distance between rows of list 70 #DEFINE logbook_row_offset .28 ; Distance between rows of list
192 193
193 logbook code 194 logbook code
194 195
195 TFT_logbook_cursor: 196 TFT_logbook_cursor:
196 call speed_fastest 197 call speed_fastest
197 WIN_BOX_BLACK .0, .239, 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
198 199
199 WIN_LEFT logbook_list_left-.16 200 WIN_LEFT logbook_list_left-.16
200 WIN_FONT FT_SMALL 201 WIN_FONT FT_SMALL
201 WIN_INVERT .0 ; Init new Wordprocessor 202 WIN_INVERT .0 ; Init new Wordprocessor
202 call TFT_standard_color 203 call TFT_standard_color
340 movf logbook_menupos_temp,W ; load last cursor position again 341 movf logbook_menupos_temp,W ; load last cursor position again
341 movwf menupos ; and set menupos byte 342 movwf menupos ; and set menupos byte
342 bcf return_from_profileview ; Do this only once while the page is loaded again! 343 bcf return_from_profileview ; Do this only once while the page is loaded again!
343 344
344 bcf logbook_page_not_empty ; Obviously the current page is NOT empty 345 bcf logbook_page_not_empty ; Obviously the current page is NOT empty
345 call TFT_logbook_cursor 346
347 movlw d'7' ; Set cursor to position 7...
348 btfsc keep_cursor_new_page ; ... if we came from the "new Page" line
349 movwf menupos ; and set menupos byte
350 bcf keep_cursor_new_page
351
352 call TFT_logbook_cursor ; Show the cursor
346 353
347 call logbook_preloop_tasks ; Clear some flags and set to Speed_eco 354 call logbook_preloop_tasks ; Clear some flags and set to Speed_eco
355 call menu_processor_bottom_line ; Show bottom line
348 logbook_loop: 356 logbook_loop:
349 btfsc switch_left ; SET/MENU? 357 btfsc switch_left ; SET/MENU?
350 goto next_logbook3 ; adjust cursor or create new page 358 goto next_logbook3 ; adjust cursor or create new page
351 btfsc switch_right ; ENTER? 359 btfsc switch_right ; ENTER?
352 bra display_profile_or_exit ; view details/profile or exit logbook 360 bra display_profile_or_exit ; view details/profile or exit logbook
1384 goto logbook ; all reset 1392 goto logbook ; all reset
1385 clrf menupos3 1393 clrf menupos3
1386 movlw logbook_row_number 1394 movlw logbook_row_number
1387 movwf menupos 1395 movwf menupos
1388 incf logbook_page_number,F ; start new screen 1396 incf logbook_page_number,F ; start new screen
1397 bsf keep_cursor_new_page ; Keep cursor on "next page"
1389 clrf CCP1CON ; stop PWM 1398 clrf CCP1CON ; stop PWM
1390 bcf PORTC,2 ; Pull PWM out to GND 1399 bcf PORTC,2 ; Pull PWM out to GND
1391 call TFT_ClearScreen 1400 call TFT_ClearScreen
1392 goto logbook2 ; start search 1401 goto logbook2 ; start search
1393 1402