Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_custom.asm @ 681:6e456a6398e0
Hardware4 support
author | heinrichsweikamp |
---|---|
date | Fri, 25 Jan 2013 18:00:49 +0100 |
parents | 92e1690ecc84 |
children | 91ae251d379f |
comparison
equal
deleted
inserted
replaced
680:c6220d340684 | 681:6e456a6398e0 |
---|---|
197 movlw .36 | 197 movlw .36 |
198 movff WREG,cf_descriptor_text ; # of descriptor text offset | 198 movff WREG,cf_descriptor_text ; # of descriptor text offset |
199 | 199 |
200 menu_custom_functions0: | 200 menu_custom_functions0: |
201 bsf leftbind | 201 bsf leftbind |
202 call PLED_ClearScreen | 202 call DISP_ClearScreen |
203 movlw d'1' | 203 movlw d'1' |
204 movwf menupos | 204 movwf menupos |
205 | 205 |
206 bcf menubit4 | 206 bcf menubit4 |
207 bcf sleepmode | 207 bcf sleepmode |
209 clrf cf32_x4 ; here: # of CustomFunction*4 | 209 clrf cf32_x4 ; here: # of CustomFunction*4 |
210 bcf first_FA ; here: =1: -, =0: + | 210 bcf first_FA ; here: =1: -, =0: + |
211 movlw 1 ; Stepsize: 1, 10, or 100. | 211 movlw 1 ; Stepsize: 1, 10, or 100. |
212 movwf cf_step | 212 movwf cf_step |
213 | 213 |
214 call PLED_topline_box | 214 call DISP_topline_box |
215 WIN_INVERT .1 ; Init new Wordprocessor | 215 WIN_INVERT .1 ; Init new Wordprocessor |
216 movff cf_title_text,WREG ; Title text in low bank | 216 movff cf_title_text,WREG ; Title text in low bank |
217 call displaytext_1_low | 217 call displaytext_1_low |
218 WIN_INVERT .0 ; Init new Wordprocessor | 218 WIN_INVERT .0 ; Init new Wordprocessor |
219 | 219 |
220 menu_custom_functions1: | 220 menu_custom_functions1: |
221 call PLED_standard_color ; Trash EEADRH... | 221 call DISP_standard_color ; Trash EEADRH... |
222 | 222 |
223 movff cf_page_number,EEADRH ; CF page number (0: 0-31, 1: 32-63) | 223 movff cf_page_number,EEADRH ; CF page number (0: 0-31, 1: 32-63) |
224 | 224 |
225 clrf timeout_counter2 | 225 clrf timeout_counter2 |
226 bcf menubit2 | 226 bcf menubit2 |
303 addlw 0x83 | 303 addlw 0x83 |
304 movwf EEADR | 304 movwf EEADR |
305 call read_eeprom ; Highbyte | 305 call read_eeprom ; Highbyte |
306 movff EEDATA,cf_value+1 | 306 movff EEDATA,cf_value+1 |
307 | 307 |
308 call PLED_standard_color ; Changed by color swatches, but trash EEADRH... | 308 call DISP_standard_color ; Changed by color swatches, but trash EEADRH... |
309 movff cf_value+0,lo | 309 movff cf_value+0,lo |
310 movff cf_value+1,hi | 310 movff cf_value+1,hi |
311 call display_customfunction | 311 call display_customfunction |
312 | 312 |
313 ; End of mask: min/max and the exit line... | 313 ; End of mask: min/max and the exit line... |
314 rcall display_minmax | 314 rcall display_minmax |
315 DISPLAYTEXT .11 ; Exit | 315 DISPLAYTEXT .11 ; Exit |
316 | 316 |
317 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | 317 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
318 call PLED_menu_cursor | 318 call DISP_menu_cursor |
319 | 319 |
320 customfunctions_loop: | 320 customfunctions_loop: |
321 call check_switches_logbook | 321 call check_switches_logbook |
322 | 322 |
323 btfsc menubit3 | 323 btfsc menubit3 |
359 movlw d'1' | 359 movlw d'1' |
360 movwf menupos | 360 movwf menupos |
361 | 361 |
362 customfunctions3: | 362 customfunctions3: |
363 clrf timeout_counter2 | 363 clrf timeout_counter2 |
364 call PLED_menu_cursor | 364 call DISP_menu_cursor |
365 | 365 |
366 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | 366 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
367 | 367 |
368 bcf menubit3 ; clear flag | 368 bcf menubit3 ; clear flag |
369 bra customfunctions_loop | 369 bra customfunctions_loop |
471 movf cf_min,W ; Retrieve current 8b value | 471 movf cf_min,W ; Retrieve current 8b value |
472 subwf cf_value,W ; Compute (value-min) | 472 subwf cf_value,W ; Compute (value-min) |
473 bc cf_min_passed ; Ok if CARRY, ie. min >= lo | 473 bc cf_min_passed ; Ok if CARRY, ie. min >= lo |
474 | 474 |
475 cf_min_failed: | 475 cf_min_failed: |
476 call PLED_warnings_color | 476 call DISP_warnings_color |
477 WIN_INVERT 1 | 477 WIN_INVERT 1 |
478 | 478 |
479 cf_min_passed: | 479 cf_min_passed: |
480 STRCAT "> " ; A min value follows | 480 STRCAT "> " ; A min value follows |
481 movff cf_min, lo | 481 movff cf_min, lo |
486 lfsr FSR2, letter+.7 ; Limit to 8 chars btw. | 486 lfsr FSR2, letter+.7 ; Limit to 8 chars btw. |
487 call word_processor | 487 call word_processor |
488 | 488 |
489 ; Display max line | 489 ; Display max line |
490 WIN_TOP .95 | 490 WIN_TOP .95 |
491 call PLED_standard_color | 491 call DISP_standard_color |
492 WIN_INVERT 0 | 492 WIN_INVERT 0 |
493 lfsr FSR2, letter | 493 lfsr FSR2, letter |
494 | 494 |
495 btfsc cf_type,7 ; A 15bit value ? | 495 btfsc cf_type,7 ; A 15bit value ? |
496 bra cf_no_max ; Don't display, hence clear line too... | 496 bra cf_no_max ; Don't display, hence clear line too... |
519 movf cf_value,W ; Retrieve current max bound | 519 movf cf_value,W ; Retrieve current max bound |
520 subwf cf_max,W ; Compute (max-lo) | 520 subwf cf_max,W ; Compute (max-lo) |
521 bc cf_max_passed ; Ok if no carry, ie. max <= lo | 521 bc cf_max_passed ; Ok if no carry, ie. max <= lo |
522 | 522 |
523 cf_max_failed: | 523 cf_max_failed: |
524 call PLED_warnings_color | 524 call DISP_warnings_color |
525 WIN_INVERT 1 | 525 WIN_INVERT 1 |
526 | 526 |
527 cf_max_passed: | 527 cf_max_passed: |
528 STRCAT "< " ; A max value follows | 528 STRCAT "< " ; A max value follows |
529 movff cf_max, lo | 529 movff cf_max, lo |
533 rcall cf_fill_line ; Fill buffer | 533 rcall cf_fill_line ; Fill buffer |
534 lfsr FSR2, letter+.7 ; Limit to 8 chars btw. | 534 lfsr FSR2, letter+.7 ; Limit to 8 chars btw. |
535 call word_processor | 535 call word_processor |
536 | 536 |
537 cf_minmax_done: | 537 cf_minmax_done: |
538 call PLED_standard_color | 538 call DISP_standard_color |
539 WIN_INVERT 0 | 539 WIN_INVERT 0 |
540 movff FSR1H, EEADRH | 540 movff FSR1H, EEADRH |
541 return | 541 return |
542 | 542 |
543 ;----------------------------------------------------------------------------- | 543 ;----------------------------------------------------------------------------- |
641 btfsc STATUS,Z | 641 btfsc STATUS,Z |
642 retlw -1 ; YES : return | 642 retlw -1 ; YES : return |
643 | 643 |
644 STRCAT_PRINT " " | 644 STRCAT_PRINT " " |
645 movf lo,W ; Get color. | 645 movf lo,W ; Get color. |
646 call PLED_set_color | 646 call DISP_set_color |
647 movlw .23 | 647 movlw .23 |
648 movff WREG,win_height ; row bottom (0-239) | 648 movff WREG,win_height ; row bottom (0-239) |
649 movlw .110 | 649 movlw .110 |
650 movff WREG,win_leftx2 ; column left (0-159) | 650 movff WREG,win_leftx2 ; column left (0-159) |
651 movlw .148-.110+1 | 651 movlw .148-.110+1 |
652 movff WREG,win_width ; column right (0-159) | 652 movff WREG,win_width ; column right (0-159) |
653 | 653 |
654 call PLED_box | 654 call DISP_box |
655 retlw -1 ; wp already done. Skip it... | 655 retlw -1 ; wp already done. Skip it... |
656 | 656 |
657 cf_type_00: ; 8bit mode. Or unrecognized type... | 657 cf_type_00: ; 8bit mode. Or unrecognized type... |
658 clrf hi | 658 clrf hi |
659 bsf leftbind | 659 bsf leftbind |
892 ; Went wrong: draw the warning line... | 892 ; Went wrong: draw the warning line... |
893 WIN_TOP .0 | 893 WIN_TOP .0 |
894 WIN_LEFT .125 | 894 WIN_LEFT .125 |
895 WIN_FONT FT_SMALL | 895 WIN_FONT FT_SMALL |
896 WIN_INVERT .1 ; Init new Wordprocessor | 896 WIN_INVERT .1 ; Init new Wordprocessor |
897 call PLED_warnings_color | 897 call DISP_warnings_color |
898 | 898 |
899 STRCPY TXT_CF2 | 899 STRCPY TXT_CF2 |
900 movff cf_checker_counter,lo | 900 movff cf_checker_counter,lo |
901 output_99x | 901 output_99x |
902 STRCAT_PRINT "!" | 902 STRCAT_PRINT "!" |