Mercurial > public > hwos_code
annotate src/convert.inc @ 637:cdff88f5a4a0
Battery menu for OSTC plus
author | heinrichsweikamp |
---|---|
date | Sun, 17 May 2020 09:34:18 +0200 |
parents | 4050675965ea |
children | 75e90cd0c2c3 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
634 | 3 ; File convert.inc combined next generation V3.09.4l |
0 | 4 ; |
5 ; Converts register values to string | |
6 ; | |
7 ; Copyright (c) 2011, Matthias Heinrichs, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2007-10-07 : [MH] Creation for OSTC sources | |
11 ; 2010-12-10 : [jDG] Optimize macro size | |
582 | 12 |
0 | 13 |
634 | 14 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
15 ; | |
16 ; The output format of all 8 and 16 bit integer printing | |
17 ; functions can be controlled with the following flags. | |
18 ; After each printing, the flags are reset automatically. | |
19 ; | |
20 ; | |
21 ; bsf leftbind ; print left-aligned (no leading spaces) | |
22 ; bsf leading_zeros ; print leading zeros | |
23 ; | |
24 ; bsf hide_digit5 ; do not print digit 5 (clip output at 9999) | |
25 ; bsf hide_digit4 ; do not print digits 5 - 4 (clip output at 999) | |
26 ; bsf hide_digit3 ; do not print digits 5 - 3 (clip output at 99) | |
27 ; bsf hide_digit2 ; do not print digits 5 - 2 (clip output at 9) | |
28 ; | |
29 ; In case the output gets clipped, the flag 'output_overflow' will be set | |
30 ; | |
31 ; bsf omit_digit_2 ; do not print digits 2 - 1 (show output as xxx--) | |
32 ; bsf omit_digit_1 ; do not print digit 1 (show output as xxxx-) | |
33 ; | |
34 ; bsf decimal_digit3 ; put a decimal point in front of digit 3 (xx.xxx) | |
35 ; bsf decimal_digit2 ; put a decimal point in front of digit 2 (xxx.xx) | |
36 ; bsf decimal_digit1 ; put a decimal point in front of digit 1 (xxxx.x) | |
37 ; | |
38 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
0 | 39 |
634 | 40 |
41 ;----------------------------------------------------------------------------- | |
42 ; | |
43 ; Output Functions for 8 Bit Integers | |
44 ; | |
45 ; output_x: x is the max number that will be shown | |
46 ; | |
47 ; Input: mpr:1 (lo) | |
48 ; | |
49 ;----------------------------------------------------------------------------- | |
50 | |
51 output_9 macro ; print only last digit (0-9) | |
52 extern output9_call | |
53 call output9_call | |
582 | 54 endm |
55 | |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
0
diff
changeset
|
56 |
634 | 57 output_99 macro ; print only 2 digits (0-99) |
582 | 58 extern output99_call |
59 call output99_call | |
0 | 60 endm |
61 | |
634 | 62 output_99x macro ; print only 2 digits with leading zero (00-99) |
582 | 63 extern output99x_call |
64 call output99x_call | |
0 | 65 endm |
604 | 66 |
634 | 67 output_99dd macro ; print only 2 digits or double-dots if zero - variant for small font |
628 | 68 extern output99dd_call |
69 call output99dd_call | |
70 endm | |
71 | |
634 | 72 output_99DD macro ; print only 2 digits or double-dots if zero - variant for big font |
628 | 73 extern output99DD_call |
74 call output99DD_call | |
75 endm | |
76 | |
634 | 77 output_256 macro ; print all 3 digits (0-255) |
78 extern output256_call | |
79 call output256_call | |
80 endm | |
81 | |
82 output_hex macro ; print in hex (00-FF), Attention: input is via WREG | |
604 | 83 extern outputHEX_call |
84 call outputHEX_call | |
85 endm | |
634 | 86 |
87 | |
88 ;----------------------------------------------------------------------------- | |
89 ; | |
90 ; Output Functions for 16 Bit Integers | |
91 ; | |
92 ; output_x: x is the max number that will be shown | |
93 ; | |
94 ; Input: mpr:2 (lo,hi) | |
95 ; | |
96 ;----------------------------------------------------------------------------- | |
97 | |
98 output_65535 macro ; print all 5 digits (0-65535) | |
99 extern output65535_call | |
100 call output65535_call | |
101 endm | |
102 | |
103 | |
104 output_9999 macro ; print only last 4 digits (0-9999) | |
105 extern output9999_call | |
106 call output9999_call | |
107 endm | |
108 | |
109 output_999 macro ; print only last 3 digits (0-999) | |
110 extern output999_call | |
111 call output999_call | |
112 endm | |
113 | |
114 | |
115 ;----------------------------------------------------------------------------- | |
116 ; | |
117 ; Conversion Functions | |
118 ; | |
119 ;----------------------------------------------------------------------------- | |
120 | |
121 extern convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm] | |
122 extern convert_cm_to_feet ; convert depth in [cm] to depth in [feet] | |
123 extern convert_meter_to_feet ; convert depth in [m] to depth in [feet] | |
124 extern convert_celsius_to_fahrenheit ; convert temperature from celsius to fahrenheit | |
125 extern convert_signed_16bit ; convert signed to unsigned 16bit, print '-' if negative | |
126 extern convert_time ; convert minutes to hours:minutes or seconds to minutes:seconds | |
127 | |
128 extern output_date ; print date with day, month and year | |
129 extern output_date_short ; print date with day and month only | |
130 extern output_secs_as_days_hours ; print seconds as days and hours | |
131 | |
132 ;----------------------------------------------------------------------------- | |
133 | |
134 |