comparison code_part1/OSTC_code_asm_part1/altimeter.asm @ 445:6e57b5bb98ce

localisation part 1 from Sergei
author heinrichsweikamp
date Thu, 11 Aug 2011 20:01:55 +0200
parents 904863f96582
children ab2686087bce
comparison
equal deleted inserted replaced
444:f6cdd0079c36 445:6e57b5bb98ce
112 WIN_LEFT .90 112 WIN_LEFT .90
113 WIN_INVERT .0 113 WIN_INVERT .0
114 WIN_FONT .0 114 WIN_FONT .0
115 call PLED_standard_color 115 call PLED_standard_color
116 116
117 STRCPY "Alt: " 117 STRCPY TXT_ALT5
118 118
119 movff altitude+0,lo ; BANK-SAFE read altitude 119 movff altitude+0,lo ; BANK-SAFE read altitude
120 movff altitude+1,hi 120 movff altitude+1,hi
121 btfss hi,7 ; Is altitude negativ ? 121 btfss hi,7 ; Is altitude negativ ?
122 bra altimeter_2 ; No: just print it 122 bra altimeter_2 ; No: just print it
130 altimeter_2: 130 altimeter_2:
131 bsf leftbind 131 bsf leftbind
132 output_16 132 output_16
133 bcf leftbind 133 bcf leftbind
134 134
135 STRCAT_PRINT "m " 135 STRCAT_PRINT TXT_METER5
136 return 136 return
137 137
138 ;============================================================================= 138 ;=============================================================================
139 ; Compute altitude, using the formula: 139 ; Compute altitude, using the formula:
140 ; H(P) = 18.787 log10(P0/P) (Log base 10) 140 ; H(P) = 18.787 log10(P0/P) (Log base 10)
255 rrcf hi 255 rrcf hi
256 rrcf lo 256 rrcf lo
257 bsf leftbind 257 bsf leftbind
258 output_16 258 output_16
259 259
260 STRCAT_PRINT " mbar " 260 STRCAT_PRINT TXT_MBAR7
261 261
262 WIN_TOP .65 ; Action enable 262 WIN_TOP .65 ; Action enable
263 lfsr FSR2, letter 263 lfsr FSR2, letter
264 OUTPUTTEXTH .290 264 OUTPUTTEXTH .290
265 GETCUSTOM8 .49 265 GETCUSTOM8 .49
294 294
295 altimeter_menu_3: 295 altimeter_menu_3:
296 bsf leftbind 296 bsf leftbind
297 output_16 297 output_16
298 bcf leftbind 298 bcf leftbind
299 STRCAT_PRINT "m " 299 STRCAT_PRINT TXT_METER5
300 300
301 alt_menu_loop: 301 alt_menu_loop:
302 call PLED_menu_cursor ; Display cursor 302 call PLED_menu_cursor ; Display cursor
303 bcf switch_left ; reset buttons state 303 bcf switch_left ; reset buttons state
304 bcf switch_right 304 bcf switch_right