view network/test_avr.h @ 110:4eb5a746d7af avr-http

Import avrusbmodem code minus the USB bits. Not built yet.
author Matt Johnston <matt@ucc.asn.au>
date Sat, 15 Sep 2012 21:49:05 +0800
parents b523761181f5
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