Date:2011-03-11 21:27:03 (8 years 8 months ago)
Author:Werner Almesberger
Commit:553c981551fdf18361e076a26e6fe7427fd2f217
Message:atusb/fw/flash.c: implemented flash_can_write and flash_read (were stubs)

Files: atusb/fw/flash.c (3 diffs)

Change Details

atusb/fw/flash.c
1414#include <stdint.h>
1515
1616#include <avr/boot.h>
17#include <avr/pgmspace.h>
1718
1819#include "dfu.h"
1920#include "board.h"
...... 
3031
3132int flash_can_write(uint16_t size)
3233{
33    return 1;
34    return payload+size <= BOOT_ADDR;
3435}
3536
3637
...... 
6768
6869uint16_t flash_read(uint8_t *buf, uint16_t size)
6970{
70    return 0;
71    uint16_t got = 0;
72
73    while (size && payload != (uint32_t) FLASHEND+1) {
74        *buf++ = pgm_read_byte(payload);
75        payload++;
76        size--;
77        got++;
78    }
79    return got;
7180}

Archive Download the corresponding diff file



interactive