Rev 726 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 726 | Rev 727 | ||
---|---|---|---|
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // + Copyright (c) 04.2007 Holger Buss |
2 | // + Copyright (c) 04.2007 Holger Buss |
3 | // + Nur für den privaten Gebrauch |
3 | // + Nur für den privaten Gebrauch |
4 | // + www.MikroKopter.com |
4 | // + www.MikroKopter.com |
5 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
5 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
6 | // + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
6 | // + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
7 | // + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
7 | // + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
8 | // + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
8 | // + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
9 | // + bzgl. der Nutzungsbedingungen aufzunehmen. |
9 | // + bzgl. der Nutzungsbedingungen aufzunehmen. |
10 | // + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
10 | // + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
11 | // + Verkauf von Luftbildaufnahmen, usw. |
11 | // + Verkauf von Luftbildaufnahmen, usw. |
12 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
12 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
13 | // + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
13 | // + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
14 | // + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
14 | // + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
15 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
15 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
16 | // + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
16 | // + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
17 | // + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
17 | // + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
18 | // + eindeutig als Ursprung verlinkt und genannt werden |
18 | // + eindeutig als Ursprung verlinkt und genannt werden |
19 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
19 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
20 | // + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
20 | // + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
21 | // + Benutzung auf eigene Gefahr |
21 | // + Benutzung auf eigene Gefahr |
22 | // + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
22 | // + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
23 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
23 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
24 | // + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
24 | // + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
25 | // + mit unserer Zustimmung zulässig |
25 | // + mit unserer Zustimmung zulässig |
26 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
26 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
27 | // + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
27 | // + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
28 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
28 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
29 | // + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
29 | // + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
30 | // + this list of conditions and the following disclaimer. |
30 | // + this list of conditions and the following disclaimer. |
31 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
31 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
32 | // + from this software without specific prior written permission. |
32 | // + from this software without specific prior written permission. |
33 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
33 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
34 | // + for non-commercial use (directly or indirectly) |
34 | // + for non-commercial use (directly or indirectly) |
35 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
35 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
36 | // + with our written permission |
36 | // + with our written permission |
37 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
37 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
38 | // + clearly linked as origin |
38 | // + clearly linked as origin |
39 | // + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
39 | // + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
40 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
40 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
41 | // + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
41 | // + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
42 | // + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
42 | // + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
43 | // + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
43 | // + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
44 | // + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
44 | // + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
45 | // + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
45 | // + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
46 | // + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
46 | // + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
47 | // + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
47 | // + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
48 | // + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
48 | // + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
49 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
49 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
50 | // + POSSIBILITY OF SUCH DAMAGE. |
50 | // + POSSIBILITY OF SUCH DAMAGE. |
51 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
51 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
52 | #include <avr/boot.h> |
52 | #include <avr/boot.h> |
53 | 53 | ||
54 | #include <avr/io.h> |
54 | #include <avr/io.h> |
55 | #include <avr/interrupt.h> |
55 | #include <avr/interrupt.h> |
56 | 56 | ||
57 | #include "main.h" |
57 | #include "main.h" |
58 | #include "timer0.h" |
58 | #include "timer0.h" |
59 | #include "timer2.h" |
59 | #include "timer2.h" |
60 | #include "uart.h" |
60 | #include "uart.h" |
61 | #include "uart1.h" |
61 | #include "uart1.h" |
62 | #include "menu.h" |
62 | #include "menu.h" |
63 | #include "ubx.h" |
63 | #include "ubx.h" |
64 | #include "fc.h" |
64 | #include "fc.h" |
65 | #include "rc.h" |
65 | #include "rc.h" |
66 | #include "analog.h" |
66 | #include "analog.h" |
67 | #include "printf_P.h" |
67 | #include "printf_P.h" |
68 | //#include "spi.h" |
68 | //#include "spi.h" |
69 | #include "mm3.h" |
69 | #include "mm3.h" |
70 | #include "twimaster.h" |
70 | #include "twimaster.h" |
71 | #include "eeprom.h" |
71 | #include "eeprom.h" |
72 | #include "_Settings.h" |
72 | #include "_Settings.h" |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | uint8_t BoardRelease = 10; |
76 | uint8_t BoardRelease = 10; |
77 | 77 | ||
78 | 78 | ||
79 | //############################################################################ |
79 | //############################################################################ |
80 | //Hauptprogramm |
80 | //Hauptprogramm |
81 | int main (void) |
81 | int main (void) |
82 | //############################################################################ |
82 | //############################################################################ |
83 | { |
83 | { |
84 | unsigned int timer; |
84 | unsigned int timer; |
85 | 85 | ||
86 | // disable interrupts global |
86 | // disable interrupts global |
87 | cli(); |
87 | cli(); |
88 | 88 | ||
89 | // get board release |
89 | // get board release |
90 | DDRB = 0x00; |
90 | DDRB = 0x00; |
91 | PORTB = 0x00; |
91 | PORTB = 0x00; |
92 | for(timer = 0; timer < 1000; timer++); // make delay |
92 | for(timer = 0; timer < 1000; timer++); // make delay |
93 | if(PINB & 0x01) BoardRelease = 11; |
93 | if(PINB & 0x01) BoardRelease = 11; |
94 | else BoardRelease = 10; |
94 | else BoardRelease = 10; |
95 | 95 | ||
96 | // Set LED Ports as output |
96 | // Set LED Ports as output |
97 | DDRB |= (1<<DDB1)|(1<<DDB0); |
97 | DDRB |= (1<<DDB1)|(1<<DDB0); |
98 | ROT_ON; |
98 | ROT_ON; |
99 | GRN_OFF; |
99 | GRN_OFF; |
100 | 100 | ||
101 | MCUSR &=~(1<<WDRF); |
101 | MCUSR &=~(1<<WDRF); |
102 | WDTCSR |= (1<<WDCE)|(1<<WDE); |
102 | WDTCSR |= (1<<WDCE)|(1<<WDE); |
103 | WDTCSR = 0; |
103 | WDTCSR = 0; |
104 | 104 | ||
105 | BeepTime = 2000; |
105 | BeepTime = 2000; |
106 | 106 | ||
107 | PPM_in[CH_THRUST] = 0; |
107 | PPM_in[CH_THRUST] = 0; |
108 | StickYaw = 0; |
108 | StickYaw = 0; |
109 | StickRoll = 0; |
109 | StickRoll = 0; |
110 | StickPitch = 0; |
110 | StickPitch = 0; |
111 | 111 | ||
112 | ROT_OFF; |
112 | ROT_OFF; |
113 | 113 | ||
114 | // initalize modules |
114 | // initalize modules |
115 | TIMER0_Init(); |
115 | TIMER0_Init(); |
116 | TIMER2_Init(); |
116 | TIMER2_Init(); |
117 | USART0_Init(); |
117 | USART0_Init(); |
118 | if (BoardRelease == 11) USART1_Init(); |
118 | if (BoardRelease == 11) USART1_Init(); |
119 | RC_Init(); |
119 | RC_Init(); |
120 | ADC_Init(); |
120 | ADC_Init(); |
121 | I2C_Init(); |
121 | I2C_Init(); |
122 | MM3_Init(); |
122 | MM3_Init(); |
123 | //SPI_MasterInit(); |
123 | //SPI_MasterInit(); |
124 | 124 | ||
125 | // enable interrupts global |
125 | // enable interrupts global |
126 | sei(); |
126 | sei(); |
127 | 127 | ||
128 | VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
128 | VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
129 | VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
129 | VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
130 | VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
130 | VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
131 | 131 | ||
132 | printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",BoardRelease/10,BoardRelease%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a'); |
132 | printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",BoardRelease/10,BoardRelease%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a'); |
133 | printf("\n\r=============================="); |
133 | printf("\n\r=============================="); |
134 | GRN_ON; |
134 | GRN_ON; |
135 | 135 | ||
136 | // Parameter set handling |
136 | // Parameter set handling |
137 | ParamSet_Init(); |
137 | ParamSet_Init(); |
138 | 138 | ||
139 | if(GetParamByte(PID_ACC_PITCH) > 4) |
139 | if(GetParamByte(PID_ACC_PITCH) > 4) |
140 | { |
140 | { |
141 | printf("\n\rACC nicht abgeglichen!"); |
141 | printf("\n\rACC not calibrated!"); |
142 | } |
142 | } |
143 | 143 | ||
144 | //kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht |
144 | //wait for a short time (otherwise the RC channel check wont work below) |
145 | timer = SetDelay(500); |
145 | timer = SetDelay(500); |
146 | while(!CheckDelay(timer)); |
146 | while(!CheckDelay(timer)); |
147 | 147 | ||
148 | //Compass calibration? |
148 | //Compass calibration? |
149 | if(PPM_in[ParamSet.ChannelAssignment[CH_THRUST]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_YAW]] > 100) |
149 | if(PPM_in[ParamSet.ChannelAssignment[CH_THRUST]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_YAW]] > 100) |
150 | { |
150 | { |
151 | printf("\n\rCalibrating Compass"); |
151 | printf("\n\rCalibrating Compass"); |
152 | MM3_Calibrate(); |
152 | MM3_Calibrate(); |
153 | } |
153 | } |
154 | 154 | ||
155 | 155 | ||
156 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
156 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
157 | { |
157 | { |
158 | printf("\n\rAbgleich Luftdrucksensor.."); |
158 | printf("\n\rCalibrating air pressure sensor.."); |
159 | timer = SetDelay(1000); |
159 | timer = SetDelay(1000); |
160 | SearchAirPressureOffset(); |
160 | SearchAirPressureOffset(); |
161 | while (!CheckDelay(timer)); |
161 | while (!CheckDelay(timer)); |
162 | printf("OK\n\r"); |
162 | printf("OK\n\r"); |
163 | } |
163 | } |
164 | 164 | ||
165 | SetNeutral(); |
165 | SetNeutral(); |
166 | 166 | ||
167 | ROT_OFF; |
167 | ROT_OFF; |
168 | 168 | ||
169 | BeepTime = 2000; |
169 | BeepTime = 2000; |
170 | ExternControl.Digital[0] = 0x55; |
170 | ExternControl.Digital[0] = 0x55; |
171 | 171 | ||
172 | 172 | ||
173 | printf("\n\rSteuerung: "); |
173 | printf("\n\rControl: "); |
174 | if (ParamSet.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
174 | if (ParamSet.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
175 | else printf("Neutral"); |
175 | else printf("Neutral"); |
176 | 176 | ||
177 | printf("\n\n\r"); |
177 | printf("\n\n\r"); |
178 | 178 | ||
179 | LCD_Clear(); |
179 | LCD_Clear(); |
180 | 180 | ||
181 | I2CTimeout = 5000; |
181 | I2CTimeout = 5000; |
182 | while (1) |
182 | while (1) |
183 | { |
183 | { |
184 | if(UpdateMotor) // control interval |
184 | if(UpdateMotor) // control interval |
185 | { |
185 | { |
186 | //SPI_TransmitByte(); //# |
186 | //SPI_TransmitByte(); //# |
187 | UpdateMotor=0; // reset Flag, is enabled every 2 ms by isr of timer0 |
187 | UpdateMotor=0; // reset Flag, is enabled every 2 ms by isr of timer0 |
188 | //PORTD |= 0x08; |
188 | //PORTD |= 0x08; |
189 | MotorControl(); |
189 | MotorControl(); |
190 | 190 | ||
191 | //PORTD &= ~0x08; |
191 | //PORTD &= ~0x08; |
192 | SendMotorData(); |
192 | SendMotorData(); |
193 | ROT_OFF; |
193 | ROT_OFF; |
194 | if(PcAccess) PcAccess--; |
194 | if(PcAccess) PcAccess--; |
195 | else |
195 | else |
196 | { |
196 | { |
197 | DubWiseKeys[0] = 0; |
197 | DubWiseKeys[0] = 0; |
198 | DubWiseKeys[1] = 0; |
198 | DubWiseKeys[1] = 0; |
199 | ExternControl.Config = 0; |
199 | ExternControl.Config = 0; |
200 | ExternStickPitch= 0; |
200 | ExternStickPitch= 0; |
201 | ExternStickRoll = 0; |
201 | ExternStickRoll = 0; |
202 | ExternStickYaw = 0; |
202 | ExternStickYaw = 0; |
203 | } |
203 | } |
204 | if(SenderOkay) SenderOkay--; |
204 | if(SenderOkay) SenderOkay--; |
205 | if(!I2CTimeout) |
205 | if(!I2CTimeout) |
206 | { |
206 | { |
207 | I2CTimeout = 5; |
207 | I2CTimeout = 5; |
208 | I2C_Reset(); |
208 | I2C_Reset(); |
209 | if((BeepModulation == 0xFFFF) && MotorsOn) |
209 | if((BeepModulation == 0xFFFF) && MotorsOn) |
210 | { |
210 | { |
211 | BeepTime = 10000; // 1 second |
211 | BeepTime = 10000; // 1 second |
212 | BeepModulation = 0x0080; |
212 | BeepModulation = 0x0080; |
213 | } |
213 | } |
214 | } |
214 | } |
215 | else |
215 | else |
216 | { |
216 | { |
217 | I2CTimeout--; |
217 | I2CTimeout--; |
218 | ROT_OFF; |
218 | ROT_OFF; |
219 | } |
219 | } |
220 | if(SIO_DEBUG && !UpdateMotor) |
220 | if(SIO_DEBUG && !UpdateMotor) |
221 | { |
221 | { |
222 | DatenUebertragung(); |
222 | DatenUebertragung(); |
223 | BearbeiteRxDaten(); |
223 | BearbeiteRxDaten(); |
224 | } |
224 | } |
225 | else BearbeiteRxDaten(); |
225 | else BearbeiteRxDaten(); |
226 | if(CheckDelay(timer)) |
226 | if(CheckDelay(timer)) |
227 | { |
227 | { |
228 | if(UBat < ParamSet.LowVoltageWarning) |
228 | if(UBat < ParamSet.LowVoltageWarning) |
229 | { |
229 | { |
230 | if(BeepModulation == 0xFFFF) |
230 | if(BeepModulation == 0xFFFF) |
231 | { |
231 | { |
232 | BeepTime = 6000; // 0.6 seconds |
232 | BeepTime = 6000; // 0.6 seconds |
233 | BeepModulation = 0x0300; |
233 | BeepModulation = 0x0300; |
234 | } |
234 | } |
235 | } |
235 | } |
236 | //SPI_StartTransmitPacket();//# |
236 | //SPI_StartTransmitPacket();//# |
237 | timer = SetDelay(100); |
237 | timer = SetDelay(100); |
238 | } |
238 | } |
239 | } |
239 | } |
240 | } |
240 | } |
241 | return (1); |
241 | return (1); |
242 | } |
242 | } |
243 | 243 | ||
244 | 244 |