modified callback type

This commit is contained in:
Markus Fröschle
2013-07-29 21:06:18 +00:00
parent 8e899f146b
commit fa35d25903
3 changed files with 4 additions and 26 deletions

View File

@@ -39,7 +39,7 @@ typedef enum
ILLEGAL_SECTOR /* flash sector number invalid */ ILLEGAL_SECTOR /* flash sector number invalid */
} err_t; } err_t;
typedef err_t (*memcpy_callback_t)(uint8_t *dst, uint8_t *src, uint32_t length); typedef err_t (*memcpy_callback_t)(uint8_t *dst, uint8_t *src, size_t length);
extern void srec_execute(char *filename); extern void srec_execute(char *filename);
extern err_t read_srecords(char *filename, void **start_address, uint32_t *actual_length, memcpy_callback_t callback); extern err_t read_srecords(char *filename, void **start_address, uint32_t *actual_length, memcpy_callback_t callback);

View File

@@ -75,18 +75,6 @@ static err_t simulate()
return ret; return ret;
} }
static err_t memcpy(uint8_t *dst, uint8_t *src, uint32_t length)
{
uint8_t *end = src + length;
do
{
*dst++ = *src++;
} while (src < end);
return OK;
}
#ifdef _NOT_USED_ #ifdef _NOT_USED_
static err_t flash(uint8_t *dst, uint8_t *src, uint32_t length) static err_t flash(uint8_t *dst, uint8_t *src, uint32_t length)
{ {
@@ -101,7 +89,7 @@ static err_t flash(uint8_t *dst, uint8_t *src, uint32_t length)
/* /*
* this callback verifies the data against the S-record file contents after a write to destination * this callback verifies the data against the S-record file contents after a write to destination
*/ */
static err_t verify(uint8_t *dst, uint8_t *src, uint32_t length) static err_t verify(uint8_t *dst, uint8_t *src, size_t length)
{ {
uint8_t *end = src + length; uint8_t *end = src + length;
@@ -164,7 +152,7 @@ err_t erase_flash_sector(int sector_num)
return ILLEGAL_SECTOR; return ILLEGAL_SECTOR;
} }
err_t erase_flash_region(void *start_address, uint32_t length) err_t erase_flash_region(void *start_address, size_t length)
{ {
err_t err; err_t err;
int sector = -1; int sector = -1;

View File

@@ -27,6 +27,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "bas_printf.h" #include "bas_printf.h"
#include "bas_string.h"
#include "sd_card.h" #include "sd_card.h"
#include "diskio.h" #include "diskio.h"
#include "ff.h" #include "ff.h"
@@ -309,17 +310,6 @@ static err_t simulate()
return ret; return ret;
} }
static err_t memcpy(uint8_t *dst, uint8_t *src, uint32_t length)
{
uint8_t *end = src + length;
do
{
*dst++ = *src++;
} while (src < end);
return OK;
}
#ifdef _NOT_USED_ #ifdef _NOT_USED_
static err_t flash(uint8_t *dst, uint8_t *src, uint32_t length) static err_t flash(uint8_t *dst, uint8_t *src, uint32_t length)