4 Commits

Author SHA1 Message Date
989f08ab2d Removed unnessary code. 2015-04-24 13:52:22 +09:00
cd0b8f5ba9 getSIMR() & getSIMR() in w5200.h
In w5200.h,
Remove  the Mask value 0xA0 in getSIMR() & setSIMR()
Add to the Mask value 0xA0 in getIR() & setIR()
2015-04-17 13:33:42 +09:00
8508482bc4 Merge branch 'hotfix/opimization_FTP_client' 2015-04-15 17:29:54 +09:00
c2b6716e43 optimization FTP client 2015-04-15 17:29:42 +09:00
6 changed files with 29 additions and 16 deletions

View File

@ -1,7 +1,7 @@
//***************************************************************************** //*****************************************************************************
// //
//! \file w5200.c //! \file w5100.c
//! \brief W5200 HAL Interface. //! \brief W5100 HAL Interface.
//! \version 1.0.0 //! \version 1.0.0
//! \date 2013/10/21 //! \date 2013/10/21
//! \par Revision history //! \par Revision history

View File

@ -196,7 +196,11 @@
* - \ref MR_AI : Address Auto-Increment in Indirect Bus Interface * - \ref MR_AI : Address Auto-Increment in Indirect Bus Interface
* - \ref MR_IND : Indirect Bus Interface mode * - \ref MR_IND : Indirect Bus Interface mode
*/ */
#define MR (_W5100_IO_BASE_ + (0x0000)) // Mode #if _WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_
#define MR (_WIZCHIP_IO_BASE_ + (0x0000)) // Mode
#else
#define MR (_W5500_IO_BASE_ + (0x0000)) // Mode
#endif
/** /**
* @ingroup Common_register_group_W5100 * @ingroup Common_register_group_W5100

View File

@ -199,7 +199,11 @@
* - \ref MR_AI : Address Auto-Increment in Indirect Bus Interface * - \ref MR_AI : Address Auto-Increment in Indirect Bus Interface
* - \ref MR_IND : Indirect Bus Interface mode * - \ref MR_IND : Indirect Bus Interface mode
*/ */
#if (_WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_)
#define MR (_WIZCHIP_IO_BASE_ + (0x0000)) // Mode
#else
#define MR (_W5200_IO_BASE_ + (0x0000)) // Mode #define MR (_W5200_IO_BASE_ + (0x0000)) // Mode
#endif
/** /**
* @ingroup Common_register_group_W5200 * @ingroup Common_register_group_W5200
@ -1342,7 +1346,7 @@ void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len);
WIZCHIP_WRITE(_IMR_, imr) WIZCHIP_WRITE(_IMR_, imr)
*/ */
#define setIMR(imr) \ #define setIMR(imr) \
WIZCHIP_WRITE(IMR2, imr) WIZCHIP_WRITE(IMR2, imr & 0xA0)
/** /**
* @ingroup Common_register_access_function_W5200 * @ingroup Common_register_access_function_W5200
@ -1356,7 +1360,7 @@ void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len);
WIZCHIP_READ(_IMR_) WIZCHIP_READ(_IMR_)
*/ */
#define getIMR() \ #define getIMR() \
WIZCHIP_READ(IMR2) (WIZCHIP_READ(IMR2) & 0xA0)
/** /**
* @ingroup Common_register_access_function_W5200 * @ingroup Common_register_access_function_W5200
@ -1517,7 +1521,7 @@ void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len);
WIZCHIP_WRITE(IMR2, (imr2 & 0xA0)) WIZCHIP_WRITE(IMR2, (imr2 & 0xA0))
*/ */
#define setIMR2(imr2) \ #define setIMR2(imr2) \
WIZCHIP_WRITE(_IMR_, (imr2 & 0xA0)) WIZCHIP_WRITE(_IMR_, imr2)
#define setSIMR(imr2) setIMR2(imr2) #define setSIMR(imr2) setIMR2(imr2)
/** /**
@ -1532,7 +1536,7 @@ void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len);
(WIZCHIP_READ(IMR2) & 0xA0) (WIZCHIP_READ(IMR2) & 0xA0)
*/ */
#define getIMR2() \ #define getIMR2() \
(WIZCHIP_READ(_IMR_) & 0xA0) WIZCHIP_READ(_IMR_)
#define getSIMR() getIMR2() #define getSIMR() getIMR2()
/////////////////////////////////// ///////////////////////////////////
// Socket N register I/O function // // Socket N register I/O function //

View File

@ -126,8 +126,6 @@ uint8_t ftpc_run(uint8_t * dbuf)
#if defined(F_FILESYSTEM) #if defined(F_FILESYSTEM)
scan_files(ftpc.workingdir, dbuf, (int *)&size); scan_files(ftpc.workingdir, dbuf, (int *)&size);
printf("\r\n%s\r\n", dbuf); printf("\r\n%s\r\n", dbuf);
getMountedMemorySize(SPI_FLASHM, &totalSize, &availableSize);
printf(" - Available Memory Size : %ld kB / %ld kB ( %ld kB is used )\r\n", availableSize, totalSize, (totalSize - availableSize));
#else #else
if (strncmp(ftpc.workingdir, "/$Recycle.Bin", sizeof("/$Recycle.Bin")) != 0) if (strncmp(ftpc.workingdir, "/$Recycle.Bin", sizeof("/$Recycle.Bin")) != 0)
size = sprintf(dbuf, "drwxr-xr-x 1 ftp ftp 0 Dec 31 2014 $Recycle.Bin\r\n-rwxr-xr-x 1 ftp ftp 512 Dec 31 2014 test.txt\r\n"); size = sprintf(dbuf, "drwxr-xr-x 1 ftp ftp 0 Dec 31 2014 $Recycle.Bin\r\n-rwxr-xr-x 1 ftp ftp 512 Dec 31 2014 test.txt\r\n");
@ -273,7 +271,7 @@ uint8_t ftpc_run(uint8_t * dbuf)
if(gDataPutGetStart){ if(gDataPutGetStart){
switch(Command.Second){ switch(Command.Second){
case s_dir: case s_dir:
printf("dir waitng...\r\n"); printf("dir waiting...\r\n");
if((size = getSn_RX_RSR(DATA_SOCK)) > 0){ // Don't need to check SOCKERR_BUSY because it doesn't not occur. if((size = getSn_RX_RSR(DATA_SOCK)) > 0){ // Don't need to check SOCKERR_BUSY because it doesn't not occur.
printf("ok\r\n"); printf("ok\r\n");
memset(dbuf, 0, _MAX_SS); memset(dbuf, 0, _MAX_SS);
@ -290,10 +288,11 @@ uint8_t ftpc_run(uint8_t * dbuf)
} }
printf("Rcvd Data:\n\r%s\n\r", dbuf); printf("Rcvd Data:\n\r%s\n\r", dbuf);
gDataPutGetStart = 0; gDataPutGetStart = 0;
Command.Second = s_nocmd;
} }
break; break;
case s_put: case s_put:
printf("put waitng...\r\n"); printf("put waiting...\r\n");
if(strlen(ftpc.workingdir) == 1) if(strlen(ftpc.workingdir) == 1)
sprintf(ftpc.filename, "/%s", (uint8_t *)gMsgBuf); sprintf(ftpc.filename, "/%s", (uint8_t *)gMsgBuf);
else else
@ -335,10 +334,11 @@ uint8_t ftpc_run(uint8_t * dbuf)
}while(remain_filesize != 0); }while(remain_filesize != 0);
#endif #endif
gDataPutGetStart = 0; gDataPutGetStart = 0;
Command.Second = s_nocmd;
disconnect(DATA_SOCK); disconnect(DATA_SOCK);
break; break;
case s_get: case s_get:
printf("get waitng...\r\n"); printf("get waiting...\r\n");
if(strlen(ftpc.workingdir) == 1) if(strlen(ftpc.workingdir) == 1)
sprintf(ftpc.filename, "/%s", (uint8_t *)gMsgBuf); sprintf(ftpc.filename, "/%s", (uint8_t *)gMsgBuf);
else else
@ -399,6 +399,7 @@ uint8_t ftpc_run(uint8_t * dbuf)
} }
} }
gDataPutGetStart = 0; gDataPutGetStart = 0;
Command.Second = s_nocmd;
#endif #endif
break; break;
default: default:
@ -504,14 +505,17 @@ char proc_ftpc(char * buf)
case R_150: case R_150:
switch(Command.First){ switch(Command.First){
case f_dir: case f_dir:
Command.First = f_nocmd;
Command.Second = s_dir; Command.Second = s_dir;
gDataPutGetStart = 1; gDataPutGetStart = 1;
break; break;
case f_get: case f_get:
Command.First = f_nocmd;
Command.Second = s_get; Command.Second = s_get;
gDataPutGetStart = 1; gDataPutGetStart = 1;
break; break;
case f_put: case f_put:
Command.First = f_nocmd;
Command.Second = s_put; Command.Second = s_put;
gDataPutGetStart = 1; gDataPutGetStart = 1;
break; break;

View File

@ -16,7 +16,7 @@
//#define F_FILESYSTEM //#define F_FILESYSTEM
/* Change to your Chipset Uart function, you have to activate this feature and implement. /* Change to your Chipset Uart function, you have to activate this feature and implement.
* Board_UARTGetCharBlocking() * Change!! -> Board_UARTGetCharBlocking()
* Below is an example of a function of lpc_chip library. */ * Below is an example of a function of lpc_chip library. */
//#define ftp_getc() Board_UARTGetCharBlocking() //#define ftp_getc() Board_UARTGetCharBlocking()
@ -27,6 +27,9 @@
#ifndef ftp_getc() #ifndef ftp_getc()
#define Need_UARTGetCharBlocking_func #define Need_UARTGetCharBlocking_func
#else #else
/* Change library
* Change!! -> board_api.h,
* Below is an example of a function of lpc_chip library. */
#include "board_api.h" #include "board_api.h"
#endif #endif

View File

@ -9,8 +9,6 @@
#include "httpParser.h" #include "httpParser.h"
#include "httpUtil.h" #include "httpUtil.h"
#include "common.h"
#ifdef _USE_SDCARD_ #ifdef _USE_SDCARD_
#include "ff.h" // header file for FatFs library (FAT file system) #include "ff.h" // header file for FatFs library (FAT file system)
#endif #endif