STM32 FLASH fixes: use size_t instead of uint16_t, make interface more generic. From Freddie Chopin

This commit is contained in:
Gregory Nutt 2014-08-28 09:11:20 -06:00
parent 7fca1ae30c
commit b123f8f6bf
2 changed files with 12 additions and 12 deletions

View File

@ -51,9 +51,9 @@
static void free_getprogmeminfo(struct mallinfo * mem)
{
uint16_t page = 0, stpage = 0xFFFF;
uint16_t pagesize = 0;
int status;
size_t page = 0, stpage = 0xFFFF;
size_t pagesize = 0;
ssize_t status;
mem->arena = 0;
mem->fordblks = 0;

View File

@ -87,11 +87,11 @@ static const char *install_script_exec =
static int install_getstartpage(int startpage, int pagemargin, int desiredsize)
{
uint16_t page = 0, stpage = 0xffff;
uint16_t pagesize = 0;
size_t page = 0, stpage = 0xffff;
size_t pagesize = 0;
int maxlen = -1;
int maxlen_start = 0xffff;
int status;
ssize_t status;
for (status=0, page=0; status >= 0; page++)
{
@ -148,11 +148,11 @@ static int install_getstartpage(int startpage, int pagemargin, int desiredsize)
static int install_programflash(int startaddr, const char *source)
{
int status;
int count;
int totalsize = 0;
char *buf;
FILE *fp;
ssize_t status;
size_t count;
ssize_t totalsize = 0;
char *buf;
FILE *fp;
if ((buf = malloc(INSTALL_PROGRAMBLOCKSIZE)) == NULL)
{
@ -265,7 +265,7 @@ static int install_remove(const char *scriptname)
{
FILE *fp;
int progsize, addr, freedsize;
uint16_t page;
ssize_t page;
int status = 0;
/* Parse script */