Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/MAIN.ASM @ 494:e9b1f162799d
testing graphical velocity
author | heinrichsweikamp |
---|---|
date | Mon, 07 Nov 2011 08:39:21 +0100 |
parents | 19b9e19ea4da |
children | f5a06b9e2fef |
rev | line source |
---|---|
0 | 1 |
2 ; OSTC - diving computer code | |
482
8e1fb9cdd62a
lock sensor for surfacemode until value is stable
heinrichsweikamp
parents:
454
diff
changeset
|
3 ; Copyright (C) 2008-2011 HeinrichsWeikamp GbR |
0 | 4 |
5 ; This program is free software: you can redistribute it and/or modify | |
6 ; it under the terms of the GNU General Public License as published by | |
7 ; the Free Software Foundation, either version 3 of the License, or | |
8 ; (at your option) any later version. | |
9 | |
10 ; This program is distributed in the hope that it will be useful, | |
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ; GNU General Public License for more details. | |
14 | |
15 ; You should have received a copy of the GNU General Public License | |
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ; includes and isr | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; written: 041013 | |
22 ; last updated: 081219 | |
23 ; known bugs: | |
24 ; ToDo: | |
25 | |
26 | |
27 LIST P=18F4685 ;directive to define processor | |
28 #include <P18F4685.INC> ;processor specific variable definitions | |
29 | |
30 #include definitions.asm ; Defines, I/O Ports and variables | |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
489
diff
changeset
|
31 ; #include "../OSTC_code_c_part2/shared_definitions.h" |
494 | 32 #include shared_definitions.h |
164 | 33 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
34 reset_v code 0x0000 |
164 | 35 goto start ; Start! |
0 | 36 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
37 inter_v code 0x0008 |
0 | 38 bra HighInt ;High Priority Interrups |
39 | |
353
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
344
diff
changeset
|
40 inter_asm code 0x0018 ;Low Priority Interrups |
0 | 41 ; *** low priority interrupts not used |
42 bra HighInt ;High Priority Interrups | |
43 | |
44 HighInt: | |
45 movff BSR,0x102 ;save BSR register | |
46 movlb b'00000001' ;select Bank1 | |
47 | |
48 movff STATUS,status_temp ;save STATUS register | |
49 movff WREG,wreg_temp ;save working register | |
92 | 50 movff PRODL,prod_temp+0 |
51 movff PRODH,prod_temp+1 | |
0 | 52 |
53 movf PORTB,W ;move portb into latch register | |
54 | |
55 btfsc PIR1,TMR1IF ;Timer1 INT (external 32.768kHz Clock) | |
56 call timer1int | |
57 | |
58 btfsc INTCON,TMR0IF ;Timer0 INT (Debounce Timer) | |
59 call timer0int | |
60 | |
61 btfsc PIR1,RCIF ; UART | |
62 call uartint | |
63 | |
64 btfsc INTCON,INT0IF ; Switch left | |
238 | 65 call switch_left_int |
0 | 66 |
67 btfsc INTCON3,INT1IF ; switch right | |
238 | 68 call switch_right_int |
0 | 69 |
92 | 70 movff prod_temp+1,PRODH |
71 movff prod_temp+0,PRODL | |
0 | 72 movff wreg_temp,WREG ;restore working register |
73 movff status_temp,STATUS ;restore STATUS register | |
74 movff 0x102,BSR ;restore BSR register | |
75 retfie | |
76 | |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
77 ;============================================================================= |
174 | 78 #include multilang_text.asm ; includes textmacros |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
79 |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
80 ;============================================================================= |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
81 osct_asm code |
97 | 82 #include strings.inc |
83 | |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
238
diff
changeset
|
84 #include isr.asm ; Interrupt service routine (RTC&Sensor) |
0 | 85 #include displaytext.asm ; sends texts to wordprocessor |
86 #include math.asm ; mathematical functions | |
87 #include wait.asm ; waitroutines | |
123 | 88 #include oled_samsung.asm ; Attached in 80-System 8-Bit Mode |
89 #include aa_wordprocessor.asm ; New antialiased word processor and fonts | |
90 #include color_processor.asm ; Color image drawing. | |
330 | 91 #include dump_screen.asm ; Copy screen contains to serial interface |
0 | 92 #include valconv.asm ; outputs to POSTINC2 |
93 #include eeprom_rs232.asm ; Internal EEPROM and RS232 Interface | |
94 #include menu_custom.asm ; Menu "Custom FunctionsI" and "Custom FunctionsII" | |
95 #include menu.asm ; Main Menu and Setup Menu | |
96 #include menu_reset.asm ; Submenu "Reset" | |
97 #include menu_settime.asm ; Submenu "Set Time" | |
98 #include ms5535.asm ; Interface to MS5535A,B or C pressure sensor | |
99 #include pled_outputs.asm ; div. PLED outputs and background debugger | |
100 #include i2c_eeprom.asm ; for external I2C EEPROM and general I2C Routines | |
101 #include menu_logbook.asm ; Submenu "Logbook" | |
102 #include interface.asm ; Interface routines | |
103 #include menu_ppO2.asm ; Constant ppO2 setup menu | |
104 #include menu_battery.asm ; Submenu "Battery Info" | |
105 #include menu_gassetup.asm ; Menu "Gas Setup" | |
106 #include surfmode.asm ; Mainroutines for Surfacemode | |
107 #include divemode.asm ; Mainroutines for Divemode | |
108 #include divemode_menu.asm ; Underwater menu | |
109 #include sleepmode.asm ; Mainroutines for Sleepmode | |
110 #include adc_rtc.asm ; A/D converter (battery control) and RTC init | |
111 #include temp_extrema.asm ; Takes care of the temperature extrema logger | |
112 #include sync_clock.asm ; syncs RTC with PC | |
113 #include start.asm ; Startup and init, checks background debugger | |
114 #include simulator.asm ; Stand-alone simulator routines | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
97
diff
changeset
|
115 #include customview.asm ; Customview for divemode |
97 | 116 #include strings.asm ; Basic string operations |
0 | 117 |
125 | 118 #include altimeter.asm |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
119 ;============================================================================= |
123 | 120 #include dive_icons.asm ; Draw dive type icons in surface mode. |
62 | 121 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
122 ;============================================================================= |
123 | 123 ; Extracted from p3_wordprocessor includes: |
124 #include aa_fonts.asm | |
110 | 125 |
126 ;============================================================================= | |
454 | 127 MESSG "OSTC - diving computer code, Copyright (C) 2011 HeinrichsWeikamp" |
0 | 128 MESSG "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the" |
129 MESSG "Free Software Foundation, either version 3 of the License, or (at your option) any later version." | |
130 MESSG "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY" | |
131 MESSG "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details." | |
132 MESSG "You should have received a copy of the GNU General Public License along with this program.If not, see http://www.gnu.org/licenses/." | |
133 | |
238 | 134 ifdef __DEBUG |
135 MESSG "OSTC Mk.2 code compiled in DEBUG configuration!" | |
136 else | |
137 MESSG "OSTC Mk.2 code compiled in RELEASE configuration!" | |
138 endif | |
139 | |
140 | |
0 | 141 END ; end of program |
142 |