comparison network/test_avr.h @ 108:b523761181f5 avr-http

Add some replacement functions for testing
author Matt Johnston <matt@ucc.asn.au>
date Sat, 15 Sep 2012 21:43:15 +0800
parents
children
comparison
equal deleted inserted replaced
107:56d09a0969b5 108:b523761181f5
1 #ifndef _TEST_AVR_H
2 #define _TEST_AVR_H
3
4 #include <stdint.h>
5 #include <unistd.h>
6
7 static uint16_t _crc_ccitt_update (uint16_t crc, uint8_t data)
8 {
9 data ^= crc & 0xff;
10 data ^= data << 4;
11
12 return ((((uint16_t)data << 8) | ((crc >> 8) & 0xff)) ^ (uint8_t)(data >> 4)
13 ^ ((uint16_t)data << 3));
14 }
15
16 static void _delay_ms (double __ms)
17 {
18 usleep(__ms*1000);
19 }
20
21 static
22
23
24 #endif // _TEST_AVR_H