Contiki-Inga 3.x
clock.c.BACKUP.2341.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Swedish Institute of Computer Science.
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
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  */
32  /**
33  * \brief This module contains AVR-specific code to implement
34  * the Contiki core clock functions.
35  *
36  * \author David Kopf <dak664@embarqmail.com> and others.
37  *
38 */
39 /** \addtogroup avr
40  * @{
41  */
42  /**
43  * \defgroup avrclock AVR clock implementation
44  * @{
45  */
46 /**
47  * \file
48  * This file contains AVR-specific code to implement the Contiki core clock functions.
49  *
50  */
51 /**
52  * These routines define the AVR-specific calls declared in /core/sys/clock.h
53  * CLOCK_SECOND is the number of ticks per second.
54  * It is defined through CONF_CLOCK_SECOND in the contiki-conf.h for each platform.
55  * The usual AVR defaults are 128 or 125 ticks per second, counting a prescaled CPU clock
56  * using the 8 bit timer0.
57  *
58  * clock_time_t is usually declared by the platform as an unsigned 16 bit data type,
59  * thus intervals up to 512 or 524 seconds can be measured with ~8 millisecond precision.
60  * For longer intervals the 32 bit clock_seconds() is available.
61  *
62  * Since a carry to a higer byte can occur during an interrupt, declaring them non-static
63  * for direct examination can cause occasional time reversals!
64  *
65  * clock-avr.h contains the specific setup code for each mcu.
66  */
67 #include "sys/clock.h"
68 #include "dev/clock-avr.h"
69 #include "sys/etimer.h"
70 
71 #include <avr/io.h>
72 #include <avr/interrupt.h>
73 
74 <<<<<<< HEAD
75 /* Two tick counters avoid a software divide when CLOCK_SECOND is not a power of two. */
76 #if CLOCK_SECOND && (CLOCK_SECOND - 1)
77 #define TWO_COUNTERS 1
78 #endif
79 
80 /* count is usually a 16 bit variable, although the platform can declare it otherwise */
81 static volatile clock_time_t count;
82 #if TWO_COUNTERS
83 /* scount is the 8 bit counter that counts ticks modulo CLOCK_SECONDS */
84 static volatile uint8_t scount;
85 #endif
86 /* seconds is available globally but non-atomic update during interrupt can cause time reversals */
87 =======
88 /*
89  CLOCK_SECOND is the number of ticks per second.
90  It is defined through CONF_CLOCK_SECOND in the contiki-conf.h for each platform.
91  The usual AVR defaults are 128 or 125 ticks per second, counting a prescaled CPU clock
92  using the 8 bit timer0.
93 
94  As clock_time_t is an unsigned 16 bit data type, intervals up to 512 or 524 seconds
95  can be measured with ~8 millisecond precision.
96  For longer intervals a 32 bit global is incremented every second.
97 
98  clock-avr.h contains the specific setup code for each mcu.
99 
100 */
101 
102 /* count is a 16 bit tick counter that wraps every ~10 minutes, returned by clock_time() */
103 static volatile clock_time_t count;
104 /* scount is the 8 bit counter that counts ticks modulo CLOCK_SECONDS */
105 static volatile uint8_t scount;
106 /* seconds is the number of seconds since startup, returned by clock_seconds() */
107 >>>>>>> 5e18239... Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer
108 volatile unsigned long seconds;
109 /* sleepseconds is the number of seconds sleeping since startup, available globally */
110 long sleepseconds;
111 
112 /* Set RADIOSTATS to monitor radio on time (must also be set in the radio driver) */
113 #if RF230BB && AVR_WEBSERVER
114 #define RADIOSTATS 1
115 #endif
116 
117 #if RADIOSTATS
118 static volatile uint8_t rcount;
119 volatile unsigned long radioontime;
120 extern uint8_t RF230_receive_on;
121 #endif
122 
123 /* Set RADIO_CONF_CALIBRATE_INTERVAL for periodic calibration of the PLL during extended radio on time.
124  * The RF230 data sheet suggests every 5 minutes if the temperature is fluctuating.
125  * At present the specified interval is ignored, and an 8 bit counter gives 256 second intervals.
126  * Actual calibration is done by the driver on the next transmit request.
127  */
128 #if RADIO_CONF_CALIBRATE_INTERVAL
129 extern volatile uint8_t rf230_calibrate;
130 static uint8_t calibrate_interval;
131 #endif
132 
133 <<<<<<< HEAD
134 /*---------------------------------------------------------------------------*/
135 /**
136  * Start the clock by enabling the timer comparison interrupts.
137  */
138 void
139 clock_init(void)
140 {
141  cli ();
142  OCRSetup();
143  sei ();
144 }
145 /*---------------------------------------------------------------------------*/
146 /**
147  * Return the tick counter. When 16 bit it typically wraps every 10 minutes.
148  * The comparison avoids the need to disable clock interrupts for an atomic
149  * read of the multi-byte variable.
150  */
151 clock_time_t
152 clock_time(void)
153 {
154  clock_time_t tmp;
155  do {
156  tmp = count;
157  } while(tmp != count);
158  return tmp;
159 }
160 /*---------------------------------------------------------------------------*/
161 /**
162  * Return seconds, default is time since startup.
163  * The comparison avoids the need to disable clock interrupts for an atomic
164  * read of the four-byte variable.
165  */
166 unsigned long
167 clock_seconds(void)
168 {
169  unsigned long tmp;
170  do {
171  tmp = seconds;
172  } while(tmp != seconds);
173  return tmp;
174 }
175 /*---------------------------------------------------------------------------*/
176 /**
177  * Set seconds, e.g. to a standard epoch for an absolute date/time.
178  */
179 void
180 clock_set_seconds(unsigned long sec)
181 {
182  seconds = sec;
183 }
184 /*---------------------------------------------------------------------------*/
185 /**
186  * Wait for a number of clock ticks.
187  */
188 void
189 clock_wait(clock_time_t t)
190 {
191  clock_time_t endticks = clock_time() + t;
192  if (sizeof(clock_time_t) == 1) {
193  while ((signed char )(clock_time() - endticks) < 0) {;}
194  } else if (sizeof(clock_time_t) == 2) {
195  while ((signed short)(clock_time() - endticks) < 0) {;}
196  } else {
197  while ((signed long )(clock_time() - endticks) < 0) {;}
198  }
199 }
200 /*---------------------------------------------------------------------------*/
201 /**
202  * Delay the CPU for up to 65535*(4000000/F_CPU) microseconds.
203  * Copied from _delay_loop_2 in AVR library delay_basic.h, 4 clocks per loop.
204  * For accurate short delays, inline _delay_loop_2 in the caller, use a constant
205  * value for the delay, and disable interrupts if necessary.
206  */
207 static inline void my_delay_loop_2(uint16_t __count) __attribute__((always_inline));
208 void
209 my_delay_loop_2(uint16_t __count)
210 {
211  __asm__ volatile (
212  "1: sbiw %0,1" "\n\t"
213  "brne 1b"
214  : "=w" (__count)
215  : "0" (__count)
216  );
217 }
218 void
219 clock_delay_usec(uint16_t howlong)
220 {
221 #if 0
222 /* Accurate delay at any frequency, but introduces a 64 bit intermediate
223  * and has a 279 clock overhead.
224  */
225  if(howlong<=(uint16_t)(279000000UL/F_CPU)) return;
226  howlong-=(uint16_t) (279000000UL/F_CPU);
227  my_delay_loop_2(((uint64_t)(howlong) * (uint64_t) F_CPU) / 4000000ULL);
228  /* Remaining numbers tweaked for the breakpoint CPU frequencies */
229  /* Add other frequencies as necessary */
230 #elif F_CPU>=16000000UL
231  if(howlong<1) return;
232  my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000)));
233 #elif F_CPU >= 12000000UL
234  if(howlong<2) return;
235  howlong-=(uint16_t) (3*12000000/F_CPU);
236  my_delay_loop_2((howlong*(uint16_t)(F_CPU/3250000)));
237 #elif F_CPU >= 8000000UL
238  if(howlong<4) return;
239  howlong-=(uint16_t) (3*8000000/F_CPU);
240  my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2);
241 #elif F_CPU >= 4000000UL
242  if(howlong<5) return;
243  howlong-=(uint16_t) (4*4000000/F_CPU);
244  my_delay_loop_2((howlong*(uint16_t)(F_CPU/2000000))/2);
245 #elif F_CPU >= 2000000UL
246  if(howlong<11) return;
247  howlong-=(uint16_t) (10*2000000/F_CPU);
248  my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4);
249 #elif F_CPU >= 1000000UL
250  if(howlong<=17) return;
251  howlong-=(uint16_t) (17*1000000/F_CPU);
252  my_delay_loop_2((howlong*(uint16_t)(F_CPU/1000000))/4);
253 #else
254  howlong >> 5;
255  if (howlong < 1) return;
256  my_delay_loop_2(howlong);
257 #endif
258 }
259 #if 0
260 /*---------------------------------------------------------------------------*/
261 /**
262  * Legacy delay. The original clock_delay for the msp430 used a granularity
263  * of 2.83 usec. This approximates that delay for values up to 1456 usec.
264  * (The largest core call in leds.c uses 400).
265  */
266 void
267 clock_delay(unsigned int howlong)
268 {
269  if(howlong<2) return;
270  clock_delay_usec((45*howlong)>>4);
271 }
272 #endif
273 /*---------------------------------------------------------------------------*/
274 /**
275  * Delay up to 65535 milliseconds.
276  * \param dt How many milliseconds to delay.
277  *
278  * Neither interrupts nor the watchdog timer is disabled over the delay.
279  * Platforms are not required to implement this call.
280  * \note This will break for CPUs clocked above 260 MHz.
281  */
282 void
283 clock_delay_msec(uint16_t howlong)
284 {
285 
286 #if F_CPU>=16000000
287  while(howlong--) clock_delay_usec(1000);
288 #elif F_CPU>=8000000
289  uint16_t i=996;
290  while(howlong--) {clock_delay_usec(i);i=999;}
291 #elif F_CPU>=4000000
292  uint16_t i=992;
293  while(howlong--) {clock_delay_usec(i);i=999;}
294 #elif F_CPU>=2000000
295  uint16_t i=989;
296  while(howlong--) {clock_delay_usec(i);i=999;}
297 #else
298  uint16_t i=983;
299  while(howlong--) {clock_delay_usec(i);i=999;}
300 #endif
301 }
302 =======
303 #if 0
304 >>>>>>> 5e18239... Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer
305 /*---------------------------------------------------------------------------*/
306 /**
307  * Adjust the system current clock time.
308  * \param dt How many ticks to add
309  *
310  * Typically used to add ticks after an MCU sleep
311  * clock_seconds will increment if necessary to reflect the tick addition.
312  * Leap ticks or seconds can (rarely) be introduced if the ISR is not blocked.
313  */
314 <<<<<<< HEAD
315 void
316 clock_adjust_ticks(clock_time_t howmany)
317 {
318  uint8_t sreg = SREG;cli();
319  count += howmany;
320 #if TWO_COUNTERS
321  howmany+= scount;
322 #endif
323  while(howmany >= CLOCK_SECOND) {
324  howmany -= CLOCK_SECOND;
325  seconds++;
326  sleepseconds++;
327 =======
328 void clock_adjust_seconds(uint8_t howmany) {
329  seconds += howmany;
330  sleepseconds +=howmany;
331  count += howmany * CLOCK_SECOND;
332 >>>>>>> 5e18239... Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer
333 #if RADIOSTATS
334  if (RF230_receive_on) radioontime += 1;
335 #endif
336  }
337 #if TWO_COUNTERS
338  scount = howmany;
339 #endif
340  SREG=sreg;
341 }
342 #endif
343 
344 /*---------------------------------------------------------------------------*/
345 /* This routine can be called to add ticks to the clock after a sleep.
346  */
347 void clock_adjust_ticks(uint16_t howmany) {
348  count += howmany;
349  scount += howmany;
350  while(scount >= CLOCK_SECOND) {
351  scount -= CLOCK_SECOND;
352  seconds++;
353  sleepseconds++;
354 #if RADIOSTATS
355  if (RF230_receive_on) radioontime += 1;
356 #endif
357  }
358 }
359 /*---------------------------------------------------------------------------*/
360 /* This it the timer comparison match interrupt.
361  * It maintains the tick counter, clock_seconds, and etimer updates.
362  *
363  * If the interrupts derive from an external crystal, the CPU instruction
364  * clock can optionally be phase locked to it. This allows accurate rtimer
365  * interrupts for strobe detection during radio duty cycling.
366  * Phase lock is accomplished by adjusting OSCCAL based on the phase error
367  * since the last interrupt.
368  */
369 /*---------------------------------------------------------------------------*/
370 #if defined(DOXYGEN)
371 /** \brief ISR for the TIMER0 or TIMER2 interrupt as defined in
372  * clock-avr.h for the particular MCU.
373  */
374 void AVR_OUTPUT_COMPARE_INT(void);
375 #else
377 {
378  count++;
379 #if TWO_COUNTERS
380  if(++scount >= CLOCK_SECOND) {
381  scount = 0;
382 #else
383  if(count%CLOCK_SECOND==0) {
384 #endif
385  seconds++;
386 
387 #if RADIO_CONF_CALIBRATE_INTERVAL
388  /* Force a radio PLL frequency calibration every 256 seconds */
389  if (++calibrate_interval==0) {
390  rf230_calibrate=1;
391  }
392 #endif
393 
394  }
395 
396 #if RADIOSTATS
397  /* Sample radio on time. Less accurate than ENERGEST but a smaller footprint */
398  if (RF230_receive_on) {
399  if (++rcount >= CLOCK_SECOND) {
400  rcount=0;
401  radioontime++;
402  }
403  }
404 #endif
405 
406 #if F_CPU == 0x800000 && USE_32K_CRYSTAL
407 /* Special routine to phase lock CPU to 32768 watch crystal.
408  * We are interrupting 128 times per second.
409  * If RTIMER_ARCH_SECOND is a multiple of 128 we can use the residual modulo
410  * 128 to determine whether the clock is too fast or too slow.
411  * E.g. for 8192 the phase should be constant modulo 0x40
412  * OSCCAL is started in the lower range at 90, allowed to stabilize, then
413  * rapidly raised or lowered based on the phase comparison.
414  * It gives less phase noise to do this every tick and doesn't seem to hurt anything.
415  */
416 #include "rtimer-arch.h"
417 {
418 volatile static uint8_t lockcount;
419 volatile static int16_t last_phase;
420 volatile static uint8_t osccalhigh,osccallow;
421  if (seconds < 60) { //give a minute to stabilize
422  if(++lockcount >= 8192UL*128/RTIMER_ARCH_SECOND) {
423  lockcount=0;
424  rtimer_phase = TCNT3 & 0x0fff;
425  if (seconds < 2) OSCCAL=100;
426  if (last_phase > rtimer_phase) osccalhigh=++OSCCAL; else osccallow=--OSCCAL;
427  last_phase = rtimer_phase;
428  }
429  } else {
430  uint8_t error = (TCNT3 - last_phase) & 0x3f;
431  if (error == 0) {
432  } else if (error<32) {
433  OSCCAL=osccallow-1;
434  } else {
435  OSCCAL=osccalhigh+1;
436  }
437  }
438 }
439 #endif
440 
441 #if 1
442 /* gcc will save all registers on the stack if an external routine is called */
443  if(etimer_pending()) {
445  }
446 #else
447 /* doing this locally saves 9 pushes and 9 pops, but these etimer.c and process.c variables have to lose the static qualifier */
448  extern struct etimer *timerlist;
449  extern volatile unsigned char poll_requested;
450 
451 #define PROCESS_STATE_NONE 0
452 #define PROCESS_STATE_RUNNING 1
453 #define PROCESS_STATE_CALLED 2
454 
455  if (timerlist) {
456  if(etimer_process.state == PROCESS_STATE_RUNNING || etimer_process.state == PROCESS_STATE_CALLED) {
457  etimer_process.needspoll = 1;
458  poll_requested = 1;
459  }
460  }
461 #endif
462 }
463 #endif /* defined(DOXYGEN) */
464 /*---------------------------------------------------------------------------*/
465 <<<<<<< HEAD
466 /* Debugging aids */
467 =======
468 void
469 clock_init(void)
470 {
471  cli ();
472  OCRSetup();
473 //scount = count = 0;
474  sei ();
475 }
476 
477 /*---------------------------------------------------------------------------*/
478 clock_time_t
479 clock_time(void)
480 {
481  clock_time_t tmp;
482  do {
483  tmp = count;
484  } while(tmp != count);
485  return tmp;
486 }
487 #if 0
488 /*---------------------------------------------------------------------------*/
489 /**
490  * Delay the CPU for a multiple of TODO
491  */
492 void
493 clock_delay(unsigned int i)
494 {
495  for (; i > 0; i--) { /* Needs fixing XXX */
496  unsigned j;
497  for (j = 50; j > 0; j--)
498  asm volatile("nop");
499  }
500 }
501 
502 /*---------------------------------------------------------------------------*/
503 /**
504  * Wait for a number of clock ticks.
505  *
506  */
507 void
508 clock_wait(int i)
509 {
510  clock_time_t start;
511 
512  start = clock_time();
513  while(clock_time() - start < (clock_time_t)i);
514 }
515 /*---------------------------------------------------------------------------*/
516 void
517 clock_set_seconds(unsigned long sec)
518 {
519  seconds = sec;
520 }
521 #endif
522 >>>>>>> 5e18239... Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer
523 
524 #ifdef HANDLE_UNSUPPORTED_INTERRUPTS
525 /* Ignore unsupported interrupts, optionally hang for debugging */
526 /* BADISR is a gcc weak symbol that matches any undefined interrupt */
527 ISR(BADISR_vect) {
528 //static volatile uint8_t x;while (1) x++;
529 }
530 #endif
531 #ifdef HANG_ON_UNKNOWN_INTERRUPT
532 /* Hang on any unsupported interrupt */
533 /* Useful for diagnosing unknown interrupts that reset the mcu.
534  * Currently set up for 12mega128rfa1.
535  * For other mcus, enable all and then disable the conflicts.
536  */
537 static volatile uint8_t x;
538 ISR( _VECTOR(0)) {while (1) x++;}
539 ISR( _VECTOR(1)) {while (1) x++;}
540 ISR( _VECTOR(2)) {while (1) x++;}
541 ISR( _VECTOR(3)) {while (1) x++;}
542 ISR( _VECTOR(4)) {while (1) x++;}
543 ISR( _VECTOR(5)) {while (1) x++;}
544 ISR( _VECTOR(6)) {while (1) x++;}
545 ISR( _VECTOR(7)) {while (1) x++;}
546 ISR( _VECTOR(8)) {while (1) x++;}
547 ISR( _VECTOR(9)) {while (1) x++;}
548 ISR( _VECTOR(10)) {while (1) x++;}
549 ISR( _VECTOR(11)) {while (1) x++;}
550 ISR( _VECTOR(12)) {while (1) x++;}
551 ISR( _VECTOR(13)) {while (1) x++;}
552 ISR( _VECTOR(14)) {while (1) x++;}
553 ISR( _VECTOR(15)) {while (1) x++;}
554 ISR( _VECTOR(16)) {while (1) x++;}
555 ISR( _VECTOR(17)) {while (1) x++;}
556 ISR( _VECTOR(18)) {while (1) x++;}
557 ISR( _VECTOR(19)) {while (1) x++;}
558 //ISR( _VECTOR(20)) {while (1) x++;}
559 //ISR( _VECTOR(21)) {while (1) x++;}
560 ISR( _VECTOR(22)) {while (1) x++;}
561 ISR( _VECTOR(23)) {while (1) x++;}
562 ISR( _VECTOR(24)) {while (1) x++;}
563 //ISR( _VECTOR(25)) {while (1) x++;}
564 ISR( _VECTOR(26)) {while (1) x++;}
565 //ISR( _VECTOR(27)) {while (1) x++;}
566 ISR( _VECTOR(28)) {while (1) x++;}
567 ISR( _VECTOR(29)) {while (1) x++;}
568 ISR( _VECTOR(30)) {while (1) x++;}
569 ISR( _VECTOR(31)) {while (1) x++;}
570 //ISR( _VECTOR(32)) {while (1) x++;}
571 ISR( _VECTOR(33)) {while (1) x++;}
572 ISR( _VECTOR(34)) {while (1) x++;}
573 ISR( _VECTOR(35)) {while (1) x++;}
574 //ISR( _VECTOR(36)) {while (1) x++;}
575 ISR( _VECTOR(37)) {while (1) x++;}
576 //ISR( _VECTOR(38)) {while (1) x++;}
577 ISR( _VECTOR(39)) {while (1) x++;}
578 ISR( _VECTOR(40)) {while (1) x++;}
579 ISR( _VECTOR(41)) {while (1) x++;}
580 ISR( _VECTOR(42)) {while (1) x++;}
581 ISR( _VECTOR(43)) {while (1) x++;}
582 ISR( _VECTOR(44)) {while (1) x++;}
583 ISR( _VECTOR(45)) {while (1) x++;}
584 ISR( _VECTOR(46)) {while (1) x++;}
585 ISR( _VECTOR(47)) {while (1) x++;}
586 ISR( _VECTOR(48)) {while (1) x++;}
587 ISR( _VECTOR(49)) {while (1) x++;}
588 ISR( _VECTOR(50)) {while (1) x++;}
589 ISR( _VECTOR(51)) {while (1) x++;}
590 ISR( _VECTOR(52)) {while (1) x++;}
591 ISR( _VECTOR(53)) {while (1) x++;}
592 ISR( _VECTOR(54)) {while (1) x++;}
593 ISR( _VECTOR(55)) {while (1) x++;}
594 ISR( _VECTOR(56)) {while (1) x++;}
595 //ISR( _VECTOR(57)) {while (1) x++;}
596 //ISR( _VECTOR(58)) {while (1) x++;}
597 //ISR( _VECTOR(59)) {while (1) x++;}
598 //ISR( _VECTOR(60)) {while (1) x++;}
599 ISR( _VECTOR(61)) {while (1) x++;}
600 ISR( _VECTOR(62)) {while (1) x++;}
601 ISR( _VECTOR(63)) {while (1) x++;}
602 ISR( _VECTOR(64)) {while (1) x++;}
603 ISR( _VECTOR(65)) {while (1) x++;}
604 ISR( _VECTOR(66)) {while (1) x++;}
605 ISR( _VECTOR(67)) {while (1) x++;}
606 ISR( _VECTOR(68)) {while (1) x++;}
607 ISR( _VECTOR(69)) {while (1) x++;}
608 ISR( _VECTOR(70)) {while (1) x++;}
609 ISR( _VECTOR(71)) {while (1) x++;}
610 ISR( _VECTOR(72)) {while (1) x++;}
611 ISR( _VECTOR(73)) {while (1) x++;}
612 ISR( _VECTOR(74)) {while (1) x++;}
613 ISR( _VECTOR(75)) {while (1) x++;}
614 ISR( _VECTOR(76)) {while (1) x++;}
615 ISR( _VECTOR(77)) {while (1) x++;}
616 ISR( _VECTOR(78)) {while (1) x++;}
617 ISR( _VECTOR(79)) {while (1) x++;}
618 <<<<<<< HEAD
619 #endif
620 /** @} */
621 /** @} */
622 =======
623 #endif
624 >>>>>>> 5e18239... Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer