mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
strtox now returns copied length
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@
|
||||
#define _RTL837X_STDIO_H_
|
||||
|
||||
#include "uip/uip-conf.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// The serial buffer. Defines the command line size
|
||||
// Must be 2^x and <= 128
|
||||
@@ -59,7 +60,7 @@ void memcpyc(register __xdata uint8_t *dst, register __code uint8_t *src, regist
|
||||
void memset(register __xdata uint8_t *dst, register __xdata uint8_t v, register uint8_t len);
|
||||
uint16_t strlen(register __code const char *s);
|
||||
uint16_t strlen_x(register __xdata const char *s);
|
||||
void strtox(register __xdata uint8_t *dst, register __code const char *s);
|
||||
uint16_t strtox(register __xdata uint8_t *dst, register __code const char *s);
|
||||
void tcpip_output(void);
|
||||
void print_string_x(__xdata char *p);
|
||||
|
||||
|
||||
+3
-1
@@ -165,11 +165,13 @@ void memset(register __xdata uint8_t *dst, register __xdata uint8_t v, register
|
||||
*dst++ = v;
|
||||
}
|
||||
|
||||
void strtox(register __xdata uint8_t *dst, register __code const char *s)
|
||||
uint16_t strtox(register __xdata uint8_t *dst, register __code const char *s)
|
||||
{
|
||||
__xdata uint8_t *b = dst;
|
||||
while (*s)
|
||||
*dst++ = *s++;
|
||||
*dst = 0;
|
||||
return dst - b;
|
||||
}
|
||||
|
||||
uint16_t strlen(register __code const char *s)
|
||||
|
||||
Reference in New Issue
Block a user