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