Rename Files of different Devices
[owSlave2.git] / common / OWConfig.s
1
2 // Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
3 // All rights reserved. 
4 // 
5 // Redistribution and use in source and binary forms, with or without 
6 // modification, are permitted provided that the following conditions are 
7 // met: 
8 // 
9 //  * Redistributions of source code must retain the above copyright 
10 //    notice, this list of conditions and the following disclaimer. 
11 //  * Redistributions in binary form must reproduce the above copyright 
12 //    notice, this list of conditions and the following disclaimer in the 
13 //    documentation and/or other materials provided with the 
14 //    distribution. 
15 //  * All advertising materials mentioning features or use of this 
16 //    software must display the following acknowledgement: This product 
17 //    includes software developed by tm3d.de and its contributors. 
18 //  * Neither the name of tm3d.de nor the names of its contributors may 
19 //    be used to endorse or promote products derived from this software 
20 //    without specific prior written permission. 
21 // 
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
33
34
35
36 #include <avr/io.h>
37
38 #define r_temp  16
39 #define r_rwbyte  17
40 #define r_temp2  18
41 #define r_bcount  19
42 #define r_mode  20
43 #define r_sendflag 21
44 #define r_bytep 22
45 #define r_crc 23
46
47 #define r_idm1 25  
48 #define r_idm2 24
49 #define r_idn1 15  
50 #define r_idn2 14
51
52 #define xl 26
53 #define xh 27
54 #define yl 28
55 #define yh 29
56 #define zl 30
57 #define zh 31
58
59 .extern owid,8
60 .extern config_info,16
61
62 .comm mode,1  ; Aktueller Zustand nach dem die Unterprogramme aufgerufen werden
63 .comm srbyte,1 ; aktuelles Byte fuer Searchrom
64 .comm bytep,1 ; pointer fuer Zugriffe auf owid usw
65 .comm bcount,1 ;bit counter, bit wird durchgeschoben 
66 .comm rwbyte,1 ; alktuelles byte beim Senden oder Empfangen
67 .comm sendflag,1; sendfalg= 1 -> Senden sonst Empfangen
68 .comm gcontrol,1  ;im Test
69 .comm reset_indicator,1  ; zeigt an wenn ein Reset empfangen wurde (Fuer das C Programm)
70 .comm alarmflag,1
71 #ifndef _DIS_FLASH_
72 .comm flashmarker,1
73 #endif
74
75 .macro configZ m,offs
76         ldi  zl,lo8(\m)       
77         ; daten im gleichen 256 Segment
78 //#if (((handle_stable>>1)&0xFF00)!= (m&0xFF00)) 
79     ldi  zh,hi8(\m)
80 //#endif
81         add  zl,\offs
82 //#if ((pack&0x00FF)>(0xC0))
83         clr r_temp      
84         adc zh,r_temp
85 //#endif
86         
87 .endm
88
89
90 #if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__)||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
91 #include "../common/OWSet_ATTINYX4.s"
92 #endif
93  
94 #if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
95 #include "../common/OWSet_ATTINYX5.s"
96 #endif
97