3 #include "dev/clock-avr.h"
7 #include <avr/interrupt.h>
9 static volatile clock_time_t count;
10 static volatile uint8_t scount;
11 volatile unsigned long seconds;
15 #if RF230BB && AVR_WEBSERVER
20 static volatile uint8_t rcount;
21 volatile unsigned long radioontime;
22 extern uint8_t RF230_receive_on;
30 #if RADIO_CONF_CALIBRATE_INTERVAL
31 extern volatile uint8_t rf230_calibrate;
32 static uint8_t calibrate_interval;
52 void clock_adjust_seconds(uint8_t howmany) {
54 sleepseconds +=howmany;
56 if (RF230_receive_on) radioontime += howmany;
68 #if RADIO_CONF_CALIBRATE_INTERVAL
69 if (++calibrate_interval==0) {
74 if (RF230_receive_on) {
89 extern struct etimer *timerlist;
90 extern volatile unsigned char poll_requested;
92 #define PROCESS_STATE_NONE 0
93 #define PROCESS_STATE_RUNNING 1
94 #define PROCESS_STATE_CALLED 2
97 if(etimer_process.state == PROCESS_STATE_RUNNING ||
98 etimer_process.state == PROCESS_STATE_CALLED) {
99 etimer_process.needspoll = 1;
123 }
while(tmp != count);
135 for (j = 50; j > 0; j--)
151 while(
clock_time() - start < (clock_time_t)i);
166 }
while(tmp != seconds);
170 #ifdef HANG_ON_UNKNOWN_INTERRUPT
175 static volatile uint8_t x;
176 ISR( _VECTOR(0)) {
while (1) x++;}
177 ISR( _VECTOR(1)) {
while (1) x++;}
178 ISR( _VECTOR(2)) {
while (1) x++;}
179 ISR( _VECTOR(3)) {
while (1) x++;}
180 ISR( _VECTOR(4)) {
while (1) x++;}
181 ISR( _VECTOR(5)) {
while (1) x++;}
182 ISR( _VECTOR(6)) {
while (1) x++;}
183 ISR( _VECTOR(7)) {
while (1) x++;}
184 ISR( _VECTOR(8)) {
while (1) x++;}
185 ISR( _VECTOR(9)) {
while (1) x++;}
186 ISR( _VECTOR(10)) {
while (1) x++;}
187 ISR( _VECTOR(11)) {
while (1) x++;}
188 ISR( _VECTOR(12)) {
while (1) x++;}
189 ISR( _VECTOR(13)) {
while (1) x++;}
190 ISR( _VECTOR(14)) {
while (1) x++;}
191 ISR( _VECTOR(15)) {
while (1) x++;}
192 ISR( _VECTOR(16)) {
while (1) x++;}
193 ISR( _VECTOR(17)) {
while (1) x++;}
194 ISR( _VECTOR(18)) {
while (1) x++;}
195 ISR( _VECTOR(19)) {
while (1) x++;}
198 ISR( _VECTOR(22)) {
while (1) x++;}
199 ISR( _VECTOR(23)) {
while (1) x++;}
200 ISR( _VECTOR(24)) {
while (1) x++;}
202 ISR( _VECTOR(26)) {
while (1) x++;}
204 ISR( _VECTOR(28)) {
while (1) x++;}
205 ISR( _VECTOR(29)) {
while (1) x++;}
206 ISR( _VECTOR(30)) {
while (1) x++;}
207 ISR( _VECTOR(31)) {
while (1) x++;}
209 ISR( _VECTOR(33)) {
while (1) x++;}
210 ISR( _VECTOR(34)) {
while (1) x++;}
211 ISR( _VECTOR(35)) {
while (1) x++;}
213 ISR( _VECTOR(37)) {
while (1) x++;}
215 ISR( _VECTOR(39)) {
while (1) x++;}
216 ISR( _VECTOR(40)) {
while (1) x++;}
217 ISR( _VECTOR(41)) {
while (1) x++;}
218 ISR( _VECTOR(42)) {
while (1) x++;}
219 ISR( _VECTOR(43)) {
while (1) x++;}
220 ISR( _VECTOR(44)) {
while (1) x++;}
221 ISR( _VECTOR(45)) {
while (1) x++;}
222 ISR( _VECTOR(46)) {
while (1) x++;}
223 ISR( _VECTOR(47)) {
while (1) x++;}
224 ISR( _VECTOR(48)) {
while (1) x++;}
225 ISR( _VECTOR(49)) {
while (1) x++;}
226 ISR( _VECTOR(50)) {
while (1) x++;}
227 ISR( _VECTOR(51)) {
while (1) x++;}
228 ISR( _VECTOR(52)) {
while (1) x++;}
229 ISR( _VECTOR(53)) {
while (1) x++;}
230 ISR( _VECTOR(54)) {
while (1) x++;}
231 ISR( _VECTOR(55)) {
while (1) x++;}
232 ISR( _VECTOR(56)) {
while (1) x++;}
237 ISR( _VECTOR(61)) {
while (1) x++;}
238 ISR( _VECTOR(62)) {
while (1) x++;}
239 ISR( _VECTOR(63)) {
while (1) x++;}
240 ISR( _VECTOR(64)) {
while (1) x++;}
241 ISR( _VECTOR(65)) {
while (1) x++;}
242 ISR( _VECTOR(66)) {
while (1) x++;}
243 ISR( _VECTOR(67)) {
while (1) x++;}
244 ISR( _VECTOR(68)) {
while (1) x++;}
245 ISR( _VECTOR(69)) {
while (1) x++;}
246 ISR( _VECTOR(70)) {
while (1) x++;}
247 ISR( _VECTOR(71)) {
while (1) x++;}
248 ISR( _VECTOR(72)) {
while (1) x++;}
249 ISR( _VECTOR(73)) {
while (1) x++;}
250 ISR( _VECTOR(74)) {
while (1) x++;}
251 ISR( _VECTOR(75)) {
while (1) x++;}
252 ISR( _VECTOR(76)) {
while (1) x++;}
253 ISR( _VECTOR(77)) {
while (1) x++;}
254 ISR( _VECTOR(78)) {
while (1) x++;}
255 ISR( _VECTOR(79)) {
while (1) x++;}