Created
October 13, 2014 13:25
-
-
Save zarya/eeb2220e1b3e20ff5684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ets_sys.h" | |
#include "driver/uart.h" | |
#include "osapi.h" | |
#include "os_type.h" | |
#include "user_interface.h" | |
#include "functions.h" | |
int8_t ICACHE_FLASH_ATTR | |
dataStrCpy(void *pDest, const void *pSrc, int8_t maxLen) | |
{ | |
char *pTempD = pDest; | |
const char *pTempS = pSrc; | |
int8_t len; | |
if(*pTempS != '\"') | |
{ | |
return -1; | |
} | |
pTempS++; | |
for(len=0; len<maxLen; len++) | |
{ | |
if(*pTempS == '\"') | |
{ | |
*pTempD = '\0'; | |
break; | |
} | |
else | |
{ | |
*pTempD++ = *pTempS++; | |
} | |
} | |
if(len == maxLen) | |
{ | |
return -1; | |
} | |
return len; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int8_t dataStrCpy(void *pDest, const void *pSrc, int8_t maxLen); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment