view 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
line wrap: on
line source

#ifndef _TEST_AVR_H
#define _TEST_AVR_H

#include <stdint.h>
#include <unistd.h>

static uint16_t _crc_ccitt_update (uint16_t crc, uint8_t data) 
{
    data ^= crc & 0xff;
    data ^= data << 4;

    return ((((uint16_t)data << 8) | ((crc >> 8) & 0xff)) ^ (uint8_t)(data >> 4) 
            ^ ((uint16_t)data << 3));
}

static void _delay_ms (double __ms)
{
    usleep(__ms*1000);
}

static


#endif // _TEST_AVR_H