Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/MAIN.ASM @ 234:bb8940caebe1
BUGFIX Gas Usage when stops are shallowest first: CF54 (bug BB24).
author | JeanDo |
---|---|
date | Thu, 17 Mar 2011 18:32:16 +0100 |
parents | 53b16a746166 |
children | 9581e48a914f |
rev | line source |
---|---|
0 | 1 |
2 ; OSTC - diving computer code | |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
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 ; it under the terms of the GNU General Public License as published by | |
20 ; the Free Software Foundation, either versio | |
21 ; includes and isr | |
22 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
23 ; written: 041013 | |
24 ; last updated: 081219 | |
25 ; known bugs: | |
26 ; ToDo: | |
27 | |
28 | |
29 LIST P=18F4685 ;directive to define processor | |
30 #include <P18F4685.INC> ;processor specific variable definitions | |
31 | |
32 #include definitions.asm ; Defines, I/O Ports and variables | |
33 | |
164 | 34 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
35 reset_v code 0x0000 |
164 | 36 goto start ; Start! |
0 | 37 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
38 inter_v code 0x0008 |
0 | 39 bra HighInt ;High Priority Interrups |
40 | |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
41 inter_asm code 0x0018 ;Low Priority Interrups |
0 | 42 ; *** low priority interrupts not used |
43 bra HighInt ;High Priority Interrups | |
44 | |
45 HighInt: | |
46 movff BSR,0x102 ;save BSR register | |
47 movlb b'00000001' ;select Bank1 | |
48 | |
49 movff STATUS,status_temp ;save STATUS register | |
50 movff WREG,wreg_temp ;save working register | |
92 | 51 movff PRODL,prod_temp+0 |
52 movff PRODH,prod_temp+1 | |
0 | 53 |
54 movf PORTB,W ;move portb into latch register | |
55 | |
56 btfsc PIR1,TMR1IF ;Timer1 INT (external 32.768kHz Clock) | |
57 call timer1int | |
58 | |
59 btfsc INTCON,TMR0IF ;Timer0 INT (Debounce Timer) | |
60 call timer0int | |
61 | |
62 btfsc PIR2,TMR3IF ;Timer3 INT (Delay for PWM Buzzer) | |
63 call timer3int | |
64 | |
65 btfsc PIR1,RCIF ; UART | |
66 call uartint | |
67 | |
68 btfsc INTCON,INT0IF ; Switch left | |
69 call schalter_links | |
70 | |
71 btfsc INTCON3,INT1IF ; switch right | |
72 call schalter_rechts | |
73 | |
92 | 74 movff prod_temp+1,PRODH |
75 movff prod_temp+0,PRODL | |
0 | 76 movff wreg_temp,WREG ;restore working register |
77 movff status_temp,STATUS ;restore STATUS register | |
78 movff 0x102,BSR ;restore BSR register | |
79 retfie | |
80 | |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
81 ;============================================================================= |
174 | 82 #include multilang_text.asm ; includes textmacros |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
83 |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
84 ;============================================================================= |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
85 osct_asm code |
97 | 86 #include strings.inc |
87 | |
0 | 88 #include displaytext.asm ; sends texts to wordprocessor |
89 #include math.asm ; mathematical functions | |
90 #include wait.asm ; waitroutines | |
123 | 91 #include oled_samsung.asm ; Attached in 80-System 8-Bit Mode |
92 #include aa_wordprocessor.asm ; New antialiased word processor and fonts | |
93 #include color_processor.asm ; Color image drawing. | |
0 | 94 #include valconv.asm ; outputs to POSTINC2 |
95 #include eeprom_rs232.asm ; Internal EEPROM and RS232 Interface | |
96 #include menu_custom.asm ; Menu "Custom FunctionsI" and "Custom FunctionsII" | |
97 #include menu.asm ; Main Menu and Setup Menu | |
98 #include menu_reset.asm ; Submenu "Reset" | |
99 #include menu_settime.asm ; Submenu "Set Time" | |
100 #include ms5535.asm ; Interface to MS5535A,B or C pressure sensor | |
101 #include pled_outputs.asm ; div. PLED outputs and background debugger | |
102 #include i2c_eeprom.asm ; for external I2C EEPROM and general I2C Routines | |
103 #include menu_logbook.asm ; Submenu "Logbook" | |
104 #include interface.asm ; Interface routines | |
105 #include menu_ppO2.asm ; Constant ppO2 setup menu | |
106 #include menu_battery.asm ; Submenu "Battery Info" | |
107 #include menu_gassetup.asm ; Menu "Gas Setup" | |
108 #include isr.asm ; Interrupt service routine (RTC&Sensor) | |
109 #include surfmode.asm ; Mainroutines for Surfacemode | |
110 #include divemode.asm ; Mainroutines for Divemode | |
111 #include divemode_menu.asm ; Underwater menu | |
112 #include sleepmode.asm ; Mainroutines for Sleepmode | |
113 #include adc_rtc.asm ; A/D converter (battery control) and RTC init | |
114 #include temp_extrema.asm ; Takes care of the temperature extrema logger | |
115 #include sync_clock.asm ; syncs RTC with PC | |
116 #include start.asm ; Startup and init, checks background debugger | |
117 #include simulator.asm ; Stand-alone simulator routines | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
97
diff
changeset
|
118 #include customview.asm ; Customview for divemode |
97 | 119 #include strings.asm ; Basic string operations |
0 | 120 |
125 | 121 #include altimeter.asm |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
122 ;============================================================================= |
123 | 123 #include dive_icons.asm ; Draw dive type icons in surface mode. |
62 | 124 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
125 ;============================================================================= |
123 | 126 ; Extracted from p3_wordprocessor includes: |
127 #include aa_fonts.asm | |
110 | 128 |
129 ;============================================================================= | |
58 | 130 MESSG "OSTC - diving computer code, Copyright (C) 2010 HeinrichsWeikamp GbR" |
0 | 131 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" |
132 MESSG "Free Software Foundation, either version 3 of the License, or (at your option) any later version." | |
133 MESSG "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY" | |
134 MESSG "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details." | |
135 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/." | |
136 | |
137 END ; end of program | |
138 |