Date:2012-06-23 16:59:47 (7 years 7 months ago)
Author:Werner Almesberger
Commit:a59bb00a2733c721f18e4ef4b9c4a8dd3c0a8549
Message:fw/hash.[ch]: new function hash_merge_progmem to read from Flash instead of RAM

Files: fw/hash.c (2 diffs)
fw/hash.h (1 diff)

Change Details

fw/hash.c
1515#include <stdint.h>
1616#include <string.h>
1717
18#include <avr/pgmspace.h>
19
1820#include "hash.h"
1921
2022
...... 
3941}
4042
4143
44#ifdef __AVR__
45
46void hash_merge_progmem(const uint8_t *buf, uint8_t len)
47{
48    uint8_t i;
49
50    for (i = 0; i != len; i++)
51        hash[i & (HASH_SIZE-1)] ^= pgm_read_byte(buf+i);
52}
53
54#endif /* __AVR__ */
55
56
4257void hash_end(void)
4358{
4459}
fw/hash.h
1919
2020void hash_init(void);
2121void hash_merge(const uint8_t *buf, uint8_t len);
22void hash_merge_progmem(const uint8_t *buf, uint8_t len);
2223void hash_end(void);
2324bool hash_eq(const uint8_t *buf, uint8_t len, uint8_t off);
2425void hash_cp(uint8_t *buf, uint8_t len, uint8_t off);

Archive Download the corresponding diff file

Branches:
master
tornado-v1



interactive