Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/MAIN.ASM @ 834:f8afe90796d6
3.14 beta Release
CHANGE: Calculate velocity over a 6sec period
author | heinrichsweikamp |
---|---|
date | Sun, 01 May 2016 16:09:39 +0200 |
parents | 2a0e5d884fc3 |
children |
rev | line source |
---|---|
0 | 1 |
815 | 2 ; OSTC Mk.2, 2N and 2C - diving computer code |
807
c50296c3059e
BUGFIX: Divetime had unwanted "." behind the minutes
heinrichsweikamp
parents:
760
diff
changeset
|
3 ; Copyright (C) 2008-2015 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 | |
494 | 31 #include shared_definitions.h |
164 | 32 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
33 reset_v code 0x0000 |
164 | 34 goto start ; Start! |
0 | 35 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
36 inter_v code 0x0008 |
0 | 37 bra HighInt ;High Priority Interrups |
38 | |
353
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
344
diff
changeset
|
39 inter_asm code 0x0018 ;Low Priority Interrups |
0 | 40 ; *** low priority interrupts not used |
41 bra HighInt ;High Priority Interrups | |
42 | |
43 HighInt: | |
44 movlb b'00000001' ;select Bank1 | |
92 | 45 movff PRODL,prod_temp+0 |
46 movff PRODH,prod_temp+1 | |
0 | 47 |
553 | 48 movf PORTB,W ; move portb into latch register |
0 | 49 |
553 | 50 btfsc INTCON,TMR0IF ; Timer0 INT (Debounce Timer) |
0 | 51 call timer0int |
52 | |
53 btfsc INTCON,INT0IF ; Switch left | |
238 | 54 call switch_left_int |
0 | 55 |
56 btfsc INTCON3,INT1IF ; switch right | |
238 | 57 call switch_right_int |
0 | 58 |
760 | 59 btfsc PIR1,TMR1IF ; Timer1 INT (external 32.768kHz Clock) |
60 call timer1int | |
61 | |
62 btfsc PIR1,RCIF ; UART | |
63 call uartint | |
64 | |
92 | 65 movff prod_temp+1,PRODH |
66 movff prod_temp+0,PRODL | |
543 | 67 retfie FAST |
0 | 68 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
69 ;============================================================================= |
174 | 70 #include multilang_text.asm ; includes textmacros |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
71 |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
72 ;============================================================================= |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
73 osct_asm code |
97 | 74 #include strings.inc |
75 | |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
238
diff
changeset
|
76 #include isr.asm ; Interrupt service routine (RTC&Sensor) |
0 | 77 #include displaytext.asm ; sends texts to wordprocessor |
78 #include math.asm ; mathematical functions | |
79 #include wait.asm ; waitroutines | |
681 | 80 #include display_lowlevel.asm; Low level display routines |
577 | 81 #include aa_wordprocessor.asm; New antialiased word processor and fonts |
123 | 82 #include color_processor.asm ; Color image drawing. |
330 | 83 #include dump_screen.asm ; Copy screen contains to serial interface |
0 | 84 #include valconv.asm ; outputs to POSTINC2 |
85 #include eeprom_rs232.asm ; Internal EEPROM and RS232 Interface | |
86 #include menu_custom.asm ; Menu "Custom FunctionsI" and "Custom FunctionsII" | |
87 #include menu.asm ; Main Menu and Setup Menu | |
88 #include menu_reset.asm ; Submenu "Reset" | |
89 #include menu_settime.asm ; Submenu "Set Time" | |
90 #include ms5535.asm ; Interface to MS5535A,B or C pressure sensor | |
681 | 91 #include outputs.asm ; div. outputs and background debugger |
0 | 92 #include i2c_eeprom.asm ; for external I2C EEPROM and general I2C Routines |
93 #include menu_logbook.asm ; Submenu "Logbook" | |
94 #include interface.asm ; Interface routines | |
95 #include menu_ppO2.asm ; Constant ppO2 setup menu | |
96 #include menu_battery.asm ; Submenu "Battery Info" | |
97 #include menu_gassetup.asm ; Menu "Gas Setup" | |
98 #include surfmode.asm ; Mainroutines for Surfacemode | |
99 #include divemode.asm ; Mainroutines for Divemode | |
100 #include divemode_menu.asm ; Underwater menu | |
101 #include sleepmode.asm ; Mainroutines for Sleepmode | |
102 #include adc_rtc.asm ; A/D converter (battery control) and RTC init | |
103 #include temp_extrema.asm ; Takes care of the temperature extrema logger | |
104 #include sync_clock.asm ; syncs RTC with PC | |
105 #include start.asm ; Startup and init, checks background debugger | |
106 #include simulator.asm ; Stand-alone simulator routines | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
97
diff
changeset
|
107 #include customview.asm ; Customview for divemode |
97 | 108 #include strings.asm ; Basic string operations |
0 | 109 |
125 | 110 #include altimeter.asm |
62 | 111 |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
62
diff
changeset
|
112 ;============================================================================= |
123 | 113 ; Extracted from p3_wordprocessor includes: |
114 #include aa_fonts.asm | |
110 | 115 |
116 ;============================================================================= | |
815 | 117 MESSG "OSTC Mk.2, 2N and 2C - diving computer code, Copyright (C) 2015 HeinrichsWeikamp" |
0 | 118 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" |
119 MESSG "Free Software Foundation, either version 3 of the License, or (at your option) any later version." | |
120 MESSG "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY" | |
121 MESSG "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details." | |
122 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/." | |
123 | |
238 | 124 ifdef __DEBUG |
706 | 125 MESSG "OSTC2 code compiled in DEBUG configuration!" |
238 | 126 else |
706 | 127 MESSG "OSTC2 code compiled in RELEASE configuration!" |
238 | 128 endif |
129 | |
130 | |
0 | 131 END ; end of program |
132 |