- fixed data types
git-svn-id: http://moon:8086/svn/mips@12 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+14
-14
@@ -2,10 +2,10 @@
|
||||
|
||||
typedef struct _ssrec_t
|
||||
{
|
||||
UINT32 addr;
|
||||
UINT32 size;
|
||||
UINT32 type;
|
||||
UINT8 *data;
|
||||
uint32_t addr;
|
||||
uint32_t size;
|
||||
uint32_t type;
|
||||
uint8_t *data;
|
||||
|
||||
} srec_t;
|
||||
|
||||
@@ -14,10 +14,10 @@ enum srec_type
|
||||
srec_err, srec_sob, srec_data, srec_rec, srec_eob
|
||||
};
|
||||
|
||||
UINT8 h2i(UINT8 *c)
|
||||
uint8_t h2i(uint8_t *c)
|
||||
{
|
||||
int i;
|
||||
UINT8 t, b = 0;
|
||||
uint8_t t, b = 0;
|
||||
|
||||
for (i=0; i < 2; i++)
|
||||
{
|
||||
@@ -32,9 +32,9 @@ UINT8 h2i(UINT8 *c)
|
||||
return b;
|
||||
}
|
||||
|
||||
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
|
||||
int decode_srec(srec_t *pRec, uint8_t *pBuf, int buflen)
|
||||
{
|
||||
UINT8 chksum, byte;
|
||||
uint8_t chksum, byte;
|
||||
int alen, i;
|
||||
|
||||
if (!buflen)
|
||||
@@ -71,7 +71,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
|
||||
}
|
||||
pRec->size -= (alen+1);
|
||||
|
||||
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
|
||||
pRec->data = (uint8_t*) &pBuf[4 + 2*alen];
|
||||
for (i=0; i < (int)pRec->size; i++)
|
||||
{
|
||||
byte = h2i(&pRec->data[2*i]);
|
||||
@@ -86,7 +86,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
|
||||
return pRec->type;
|
||||
}
|
||||
|
||||
int srec_getline(UINT8 *pLine)
|
||||
int srec_getline(uint8_t *pLine)
|
||||
{
|
||||
char c;
|
||||
int i = 0;
|
||||
@@ -191,11 +191,11 @@ void PrintCPUinfo(void)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
UINT8 buf[256];
|
||||
uint8_t buf[256];
|
||||
srec_t srec;
|
||||
int result, srec_state, i;
|
||||
UINT32 haddr;
|
||||
volatile UINT8 *pMem;
|
||||
uint32_t haddr;
|
||||
volatile uint8_t *pMem;
|
||||
haddr = 0;
|
||||
|
||||
// ----------------------------------------------------------
|
||||
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
|
||||
if ((srec.addr + srec.size) > haddr)
|
||||
haddr = srec.addr + srec.size;
|
||||
|
||||
pMem = (UINT8*)srec.addr;
|
||||
pMem = (uint8_t*)srec.addr;
|
||||
for (i=0; i < srec.size; i++)
|
||||
*pMem++ = srec.data[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user