11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRsplits s1 into tokens. Each token is separated by any of <strong>the</strong> characters in delim.You specify <strong>the</strong> source string s1 in <strong>the</strong> first call to strtok. Subsequent calls tostrtok with s1 set to NULL will return <strong>the</strong> next token until no more token isfound, <strong>and</strong> strtok returns NULL.strtok modifies <strong>the</strong> content of s1 <strong>and</strong> pointers into s1 are returned as returnvalues.__flash char * support functionsThese functions per<strong>for</strong>m <strong>the</strong> same processing as <strong>the</strong>ir counterparts without <strong>the</strong> 'c'prefix except that <strong>the</strong>y operate on constant strings in FLASH. void *cmemchr(__flash void *s, int c, size_t n); int cmemcmp(__flash char *s1, char *s2, size_t n); void *cmemcpy(void *dst, __flash void *src, size_t n); char *cstrcat(char *s1, __flash char *s2); int cstrcmp(__flash char *s1, char *s2); size_t cstrcspn(char *s1, __flash char *cs); size_t cstrlen(__flash char *s); char *cstrncat(char *s1, __flash char *s2, size_t n); int cstrncmp(__flash char *s1, char *s2, int n); char *cstrcpy(char *dst, __flash char *src); char *cstrpbrk(char *s1, __flash char *cs); size_t cstrspn(char *s1, __flash char *cs); char *cstrstr(char *s1, __flash char *s2);Finally, <strong>the</strong> following functions are exactly like <strong>the</strong> corresponding ones without <strong>the</strong> xsuffix except that <strong>the</strong>y use elpm instead of <strong>the</strong> lpm instruction. These are useful <strong>for</strong>bootloader applications or if you want to put your constant data above <strong>the</strong> lowest 64Kbytes of Flash:cmemcpyx, cmemchrx, cmemcmpx, cstrcatx, cstrncatx, cstrcmpx,cstrncmpx, cstrcpyx, cstrncpyx, cstrcspnx, cstrlenx, cstrspnx,cstrstrx, cstrpbrkx104

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!