3 #include "dev/clock-avr.h"
7 #include <avr/interrupt.h>
24 static volatile clock_time_t count;
26 static volatile uint8_t scount;
28 volatile unsigned long seconds;
33 #if RF230BB && AVR_WEBSERVER
38 static volatile uint8_t rcount;
39 volatile unsigned long radioontime;
40 extern uint8_t RF230_receive_on;
48 #if RADIO_CONF_CALIBRATE_INTERVAL
49 extern volatile uint8_t rf230_calibrate;
50 static uint8_t calibrate_interval;
58 void clock_adjust_seconds(uint8_t howmany) {
60 sleepseconds +=howmany;
63 if (RF230_receive_on) radioontime += howmany;
79 if (RF230_receive_on) radioontime += 1;
92 #if RADIO_CONF_CALIBRATE_INTERVAL
93 if (++calibrate_interval==0) {
98 if (RF230_receive_on) {
113 extern struct etimer *timerlist;
114 extern volatile unsigned char poll_requested;
116 #define PROCESS_STATE_NONE 0
117 #define PROCESS_STATE_RUNNING 1
118 #define PROCESS_STATE_CALLED 2
121 if(etimer_process.state == PROCESS_STATE_RUNNING ||
122 etimer_process.state == PROCESS_STATE_CALLED) {
123 etimer_process.needspoll = 1;
147 }
while(tmp != count);
160 for (j = 50; j > 0; j--)
176 while(
clock_time() - start < (clock_time_t)i);
192 }
while(tmp != seconds);
196 #ifdef HANG_ON_UNKNOWN_INTERRUPT
201 static volatile uint8_t x;
202 ISR( _VECTOR(0)) {
while (1) x++;}
203 ISR( _VECTOR(1)) {
while (1) x++;}
204 ISR( _VECTOR(2)) {
while (1) x++;}
205 ISR( _VECTOR(3)) {
while (1) x++;}
206 ISR( _VECTOR(4)) {
while (1) x++;}
207 ISR( _VECTOR(5)) {
while (1) x++;}
208 ISR( _VECTOR(6)) {
while (1) x++;}
209 ISR( _VECTOR(7)) {
while (1) x++;}
210 ISR( _VECTOR(8)) {
while (1) x++;}
211 ISR( _VECTOR(9)) {
while (1) x++;}
212 ISR( _VECTOR(10)) {
while (1) x++;}
213 ISR( _VECTOR(11)) {
while (1) x++;}
214 ISR( _VECTOR(12)) {
while (1) x++;}
215 ISR( _VECTOR(13)) {
while (1) x++;}
216 ISR( _VECTOR(14)) {
while (1) x++;}
217 ISR( _VECTOR(15)) {
while (1) x++;}
218 ISR( _VECTOR(16)) {
while (1) x++;}
219 ISR( _VECTOR(17)) {
while (1) x++;}
220 ISR( _VECTOR(18)) {
while (1) x++;}
221 ISR( _VECTOR(19)) {
while (1) x++;}
224 ISR( _VECTOR(22)) {
while (1) x++;}
225 ISR( _VECTOR(23)) {
while (1) x++;}
226 ISR( _VECTOR(24)) {
while (1) x++;}
228 ISR( _VECTOR(26)) {
while (1) x++;}
230 ISR( _VECTOR(28)) {
while (1) x++;}
231 ISR( _VECTOR(29)) {
while (1) x++;}
232 ISR( _VECTOR(30)) {
while (1) x++;}
233 ISR( _VECTOR(31)) {
while (1) x++;}
235 ISR( _VECTOR(33)) {
while (1) x++;}
236 ISR( _VECTOR(34)) {
while (1) x++;}
237 ISR( _VECTOR(35)) {
while (1) x++;}
239 ISR( _VECTOR(37)) {
while (1) x++;}
241 ISR( _VECTOR(39)) {
while (1) x++;}
242 ISR( _VECTOR(40)) {
while (1) x++;}
243 ISR( _VECTOR(41)) {
while (1) x++;}
244 ISR( _VECTOR(42)) {
while (1) x++;}
245 ISR( _VECTOR(43)) {
while (1) x++;}
246 ISR( _VECTOR(44)) {
while (1) x++;}
247 ISR( _VECTOR(45)) {
while (1) x++;}
248 ISR( _VECTOR(46)) {
while (1) x++;}
249 ISR( _VECTOR(47)) {
while (1) x++;}
250 ISR( _VECTOR(48)) {
while (1) x++;}
251 ISR( _VECTOR(49)) {
while (1) x++;}
252 ISR( _VECTOR(50)) {
while (1) x++;}
253 ISR( _VECTOR(51)) {
while (1) x++;}
254 ISR( _VECTOR(52)) {
while (1) x++;}
255 ISR( _VECTOR(53)) {
while (1) x++;}
256 ISR( _VECTOR(54)) {
while (1) x++;}
257 ISR( _VECTOR(55)) {
while (1) x++;}
258 ISR( _VECTOR(56)) {
while (1) x++;}
263 ISR( _VECTOR(61)) {
while (1) x++;}
264 ISR( _VECTOR(62)) {
while (1) x++;}
265 ISR( _VECTOR(63)) {
while (1) x++;}
266 ISR( _VECTOR(64)) {
while (1) x++;}
267 ISR( _VECTOR(65)) {
while (1) x++;}
268 ISR( _VECTOR(66)) {
while (1) x++;}
269 ISR( _VECTOR(67)) {
while (1) x++;}
270 ISR( _VECTOR(68)) {
while (1) x++;}
271 ISR( _VECTOR(69)) {
while (1) x++;}
272 ISR( _VECTOR(70)) {
while (1) x++;}
273 ISR( _VECTOR(71)) {
while (1) x++;}
274 ISR( _VECTOR(72)) {
while (1) x++;}
275 ISR( _VECTOR(73)) {
while (1) x++;}
276 ISR( _VECTOR(74)) {
while (1) x++;}
277 ISR( _VECTOR(75)) {
while (1) x++;}
278 ISR( _VECTOR(76)) {
while (1) x++;}
279 ISR( _VECTOR(77)) {
while (1) x++;}
280 ISR( _VECTOR(78)) {
while (1) x++;}
281 ISR( _VECTOR(79)) {
while (1) x++;}