comparison code_part1/OSTC_code_asm_part1/menu_custom.asm @ 97:dc349e4264bb

Cleanup CF for bad 15bits value display Cleanup old printf prototype New strings macro
author JeanDo
date Sun, 12 Dec 2010 01:13:48 +0100
parents ce3283064cde
children 39d325b2a5f9
comparison
equal deleted inserted replaced
96:25433449bcb5 97:dc349e4264bb
17 17
18 18
19 ; Menu "Custom Functions", Custom Functions checker (Displays permanent warning if critical custom functions are altered) 19 ; Menu "Custom Functions", Custom Functions checker (Displays permanent warning if critical custom functions are altered)
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com 20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
21 ; written: 05/10/30 21 ; written: 05/10/30
22 ; last updated: 08/08/31 22 ; last updated: 2010/12/11
23 ; known bugs: 23 ; known bugs:
24 ; ToDo: 24 ; ToDo:
25 25
26 ;First Bank of Custom Functions: 26 ;First Bank of Custom Functions:
27 ; The custom functions are stored in the internal EEPROM after 0x80 27 ; The custom functions are stored in the internal EEPROM after 0x80
43 ; get values with GETCUSTOM8 .x with x=0...32 for 8 Bit values (stored in WREG) 43 ; get values with GETCUSTOM8 .x with x=0...32 for 8 Bit values (stored in WREG)
44 ; or with GETCUSTOM15 .x with x=0...32 for 15 Bit values (stored in lo and hi) 44 ; or with GETCUSTOM15 .x with x=0...32 for 15 Bit values (stored in lo and hi)
45 45
46 ; [jDG] 2010-11-30 More fancy displsy of the various CF types 46 ; [jDG] 2010-11-30 More fancy displsy of the various CF types
47 ; data types. When we do have a 8bit data (bit16=0), the high byte serves to 47 ; data types. When we do have a 8bit data (bit16=0), the high byte serves to
48 ; define the display format: 48 ; define the display format. Also stores min/max bounds into the PROM table.
49 ; And provides surfacemode checking of all parameters.
49 50
50 CF_INT8 EQU 0 ; Default display, 8 or 15 bits values. 51 CF_INT8 EQU 0 ; Default display, 8 or 15 bits values.
51 CF_PERCENT EQU 1 ; Displays 110% 52 CF_PERCENT EQU 1 ; Displays 110%
52 CF_DECI EQU 2 ; Displays 1.6 53 CF_DECI EQU 2 ; Displays 1.6
53 CF_CENTI EQU 3 ; Displays 1.50 54 CF_CENTI EQU 3 ; Displays 1.50
389 btfss hi,7 ; 15bit ? 390 btfss hi,7 ; 15bit ?
390 clrf hi ; NO: clear extra type flags 391 clrf hi ; NO: clear extra type flags
391 bcf hi,7 ; clear 15bit flag 392 bcf hi,7 ; clear 15bit flag
392 393
393 movff TABLAT,cf_type ; type (high byte) --> cf_type 394 movff TABLAT,cf_type ; type (high byte) --> cf_type
394 movlw CF_MILI
395 btfsc cf_type,7 ; Display all 15bits as 1.234 floats.
396 movwf cf_type
397 395
398 tblrd*+ 396 tblrd*+
399 movff TABLAT,cf_min ; Then get optional min/max 397 movff TABLAT,cf_min ; Then get optional min/max
400 tblrd*+ 398 tblrd*+
401 movff TABLAT,cf_max 399 movff TABLAT,cf_max