- Minor changes
Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@449 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -4,9 +4,12 @@
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
#define CPU_FREQ_HZ 100000000
|
||||
#include "libsys.h"
|
||||
|
||||
#include "crc32.h"
|
||||
#include "inflate.h"
|
||||
#include "libsys.h"
|
||||
|
||||
char buffer[1024*1024];
|
||||
char * volatile pPtr_r;
|
||||
@@ -16,10 +19,10 @@ volatile int file_len;
|
||||
|
||||
void handler3(void)
|
||||
{
|
||||
volatile UINT32 *pUART_stat = (UINT32*)sys_uart_stat;
|
||||
volatile UINT32 *pUART_data = (UINT32*)sys_uart_data;
|
||||
volatile UINT32 *pUART_stat = (UINT32*)sys_uart0_stat;
|
||||
volatile UINT32 *pUART_data = (UINT32*)sys_uart0_data;
|
||||
|
||||
while((0x10 & *pUART_stat))
|
||||
while(0x200 & *pUART_stat)
|
||||
{
|
||||
// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
|
||||
if (pPtr_w == &buffer[sizeof(buffer)-1])
|
||||
@@ -42,19 +45,23 @@ int READBYTE(z_stream *zs) {
|
||||
#define MAX_BUFOUT 16*1024*1024
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned char outData[MAX_BUFOUT];
|
||||
FILE *infp;
|
||||
int i, gpflags, tmp[4];
|
||||
unsigned long size, crc;
|
||||
unsigned char *fileData;
|
||||
unsigned long bytes, InflatedSize, InflatedCRC, speed_count;
|
||||
z_stream zs;
|
||||
time_t start_time, work_time;
|
||||
volatile UINT32 *pUART_stat = (UINT32*)sys_uart0_stat;
|
||||
unsigned char outData[MAX_BUFOUT];
|
||||
FILE *infp;
|
||||
int i, gpflags, tmp[4];
|
||||
unsigned long size, crc;
|
||||
unsigned char *fileData;
|
||||
unsigned long bytes, InflatedSize, InflatedCRC, speed_count;
|
||||
z_stream zs;
|
||||
time_t start_time, work_time;
|
||||
|
||||
sputs("Reading gzipped stream..\n");
|
||||
UART0_setbaud(460800);
|
||||
|
||||
printf("Reading gzipped stream..\n");
|
||||
|
||||
pPtr_r = buffer;
|
||||
pPtr_w = buffer;
|
||||
*pUART_stat = (1 << 6);
|
||||
interrupt_register(3, handler3);
|
||||
interrupt_enable(3);
|
||||
|
||||
@@ -65,6 +72,7 @@ int main(int argc, char **argv)
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
printf("file_len: %d\n", file_len);
|
||||
bytes = file_len;
|
||||
fileData = pPtr_r;
|
||||
|
||||
@@ -77,7 +85,7 @@ int main(int argc, char **argv)
|
||||
if (tmp[0] == -1)
|
||||
{
|
||||
// error reading from file
|
||||
sputs("error reading data from file\n");
|
||||
printf("error reading data from file\n");
|
||||
return 0;
|
||||
}
|
||||
tmp[1] = READBYTE(&zs);
|
||||
@@ -96,7 +104,7 @@ int main(int argc, char **argv)
|
||||
|
||||
gpflags = READBYTE(&zs);
|
||||
if ((gpflags & ~0x1f)) {
|
||||
sputs("Unknown flags set!\n");
|
||||
printf("Unknown flags set!\n");
|
||||
}
|
||||
|
||||
/* Skip file modification time (4 bytes) */
|
||||
@@ -132,12 +140,12 @@ int main(int argc, char **argv)
|
||||
READBYTE(&zs);
|
||||
}
|
||||
|
||||
sputs("Go\n");
|
||||
printf("Go\n");
|
||||
// normal test
|
||||
start_time = clock();
|
||||
if (InflateData(&zs))
|
||||
{
|
||||
sputs("Problem during decompression!\n");
|
||||
printf("Problem during decompression!\n");
|
||||
return 0;
|
||||
}
|
||||
work_time = clock() - start_time;
|
||||
|
||||
Reference in New Issue
Block a user