<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=46&amp;t=10900&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-03-04T09:12:28+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=46&amp;t=10900&amp;mode</id>
<entry>
<author><name><![CDATA[PROTON]]></name></author>
<updated>2015-03-04T09:12:28+01:00</updated>
<published>2015-03-04T09:12:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121875#p121875</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121875#p121875"/>
<title type="html"><![CDATA[Re: itoa() CooCox]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121875#p121875"><![CDATA[
Ja używam sprintf()<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1315">PROTON</a> — 4 mar 2015, o 09:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[TomTea]]></name></author>
<updated>2015-03-03T21:19:46+01:00</updated>
<published>2015-03-03T21:19:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121807#p121807</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121807#p121807"/>
<title type="html"><![CDATA[Re: itoa() CooCox]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121807#p121807"><![CDATA[
Dzięki wielkie , skorzystałem z waszych bibliotek i już działa. A co do tego że &quot;powinna być&quot; to nie wiedziałem że nie jest ona standardem, cóż całe życie się człowiek uczy <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1309">TomTea</a> — 3 mar 2015, o 21:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2015-03-03T18:14:26+01:00</updated>
<published>2015-03-03T18:14:26+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121765#p121765</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121765#p121765"/>
<title type="html"><![CDATA[Re: itoa() CooCox]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121765#p121765"><![CDATA[
tak się składa że w arm_eabi_gcc niestety w newlib niema itoa , ale to nie jest kłopot wystarczy to co w załączniku , ewentualnie własna funkcyjka np taka:<br /><br />[syntax=c]void itoa(int n, char s&#91;&#93;)<br /> {<br /> int i, sign;<br /><br /> if ((sign = n) &lt; 0)  <br />     n = -n;         <br /> i = 0;<br /> do {       <br />     s&#91;i++&#93; = n % 10 + '0';  <br /> } while ((n /= 10) &gt; 0);    <br /> if (sign &lt; 0)<br />     s&#91;i++&#93; = '-';<br /> s&#91;i&#93; = '\0';<br /> reverse(s);<br /> }[/syntax]<br /><br />naprawdę jak wolisz ...<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 3 mar 2015, o 18:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[lemurek]]></name></author>
<updated>2015-03-03T17:15:28+01:00</updated>
<published>2015-03-03T17:15:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121759#p121759</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121759#p121759"/>
<title type="html"><![CDATA[Re: itoa() CooCox]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121759#p121759"><![CDATA[
hej może to Ci jakoś pomoże...<a href="http://forum.atnel.pl/topic1625-120.html#p36933"  class="postlink">http://forum.atnel.pl/topic1625-120.html#p36933</a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=776">lemurek</a> — 3 mar 2015, o 17:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[TomTea]]></name></author>
<updated>2015-03-03T16:59:18+01:00</updated>
<published>2015-03-03T16:59:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121757#p121757</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121757#p121757"/>
<title type="html"><![CDATA[itoa() CooCox]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10900&amp;p=121757#p121757"><![CDATA[
Otóż mam problem z funkcją itoa() powinna ona być w sdtlib.h ... Ale może od początku.<br />Chciałem sobie przenieść biblioteki OLED Mirka na STM32F0 w środowisku CooCox. Jednym z takich elementów była funkcja PutInt() u mnie jej kod tak się prezentuje:<br />[syntax=c]void GFX_PutInt (int x, int y, int data, uint8_t txt_size, uint8_t color, uint8_t bg)<br />{<br />char buf&#91;16&#93;;<br />GFX_PutString(x, y, itoa(data, buf, 10), txt_size, color, bg);<br />}[/syntax]<br />I podczas  kompilacji otrzymuję taki błąd:<br /><em><br />       [cc] C:\Users\Tomek\Atollic\TrueSTUDIO\STM32_F0_DISCOVERY\OLED_Lib\src/Oled_GFX.c:334: undefined reference to `itoa'<br />       [cc] collect2.exe: error: ld returned 1 exit status<br /><br />BUILD FAILED<br />Total time: 1 second<br /></em><br />W Eclips dla AVR taka funkcja znajduje się w &lt;stdlib.h&gt;.<br /><br />Zaczołem szukać i oglądać tą bibliotekę  w CooCox i rzeczywiście nie ma takiej funkcji:<br />Zamieszczam cały kod biblioteki stdlib.h w CooCox:<br />[syntax=c]/*<br /> * stdlib.h<br /> *<br /> * Definitions for common types, variables, and functions.<br /> */<br /><br />#ifndef _STDLIB_H_<br />#define _STDLIB_H_<br /><br />#include &lt;machine/ieeefp.h&gt;<br />#include &quot;_ansi.h&quot;<br /><br />#define __need_size_t<br />#define __need_wchar_t<br />#define __need_NULL<br />#include &lt;stddef.h&gt;<br /><br />#include &lt;sys/reent.h&gt;<br />#include &lt;machine/stdlib.h&gt;<br />#ifndef __STRICT_ANSI__<br />#include &lt;alloca.h&gt;<br />#endif<br /><br />#ifdef __CYGWIN__<br />#include &lt;cygwin/stdlib.h&gt;<br />#endif<br /><br />_BEGIN_STD_C<br /><br />typedef struct <br />{<br />  int quot; /* quotient */<br />  int rem; /* remainder */<br />} div_t;<br /><br />typedef struct <br />{<br />  long quot; /* quotient */<br />  long rem; /* remainder */<br />} ldiv_t;<br /><br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />typedef struct<br />{<br />  long long int quot; /* quotient */<br />  long long int rem; /* remainder */<br />} lldiv_t;<br />#endif<br /><br />#ifndef __compar_fn_t_defined<br />#define __compar_fn_t_defined<br />typedef int (*__compar_fn_t) (const _PTR, const _PTR);<br />#endif<br /><br />#define EXIT_FAILURE 1<br />#define EXIT_SUCCESS 0<br /><br />#define RAND_MAX __RAND_MAX<br /><br />int_EXFUN(__locale_mb_cur_max,(_VOID));<br /><br />#define MB_CUR_MAX __locale_mb_cur_max()<br /><br />_VOID_EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__)));<br />int_EXFUN(abs,(int));<br />int_EXFUN(atexit,(_VOID (*__func)(_VOID)));<br />double_EXFUN(atof,(const char *__nptr));<br />#ifndef __STRICT_ANSI__<br />float_EXFUN(atoff,(const char *__nptr));<br />#endif<br />int_EXFUN(atoi,(const char *__nptr));<br />int_EXFUN(_atoi_r,(struct _reent *, const char *__nptr));<br />long_EXFUN(atol,(const char *__nptr));<br />long_EXFUN(_atol_r,(struct _reent *, const char *__nptr));<br />_PTR_EXFUN(bsearch,(const _PTR __key,<br />       const _PTR __base,<br />       size_t __nmemb,<br />       size_t __size,<br />       __compar_fn_t _compar));<br />_PTR_EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size));<br />div_t_EXFUN(div,(int __numer, int __denom));<br />_VOID_EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__)));<br />_VOID_EXFUN_NOTHROW(free,(_PTR));<br />char *  _EXFUN(getenv,(const char *__string));<br />char *_EXFUN(_getenv_r,(struct _reent *, const char *__string));<br />char *_EXFUN(_findenv,(_CONST char *, int *));<br />char *_EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));<br />#ifndef __STRICT_ANSI__<br />extern char *suboptarg;/* getsubopt(3) external variable */<br />int_EXFUN(getsubopt,(char **, char * const *, char **));<br />#endif<br />long_EXFUN(labs,(long));<br />ldiv_t_EXFUN(ldiv,(long __numer, long __denom));<br />_PTR_EXFUN_NOTHROW(malloc,(size_t __size));<br />int_EXFUN(mblen,(const char *, size_t));<br />int_EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *));<br />int_EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t));<br />int_EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *));<br />int_EXFUN(wctomb,(char *, wchar_t));<br />int_EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *));<br />size_t_EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t));<br />size_t_EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *));<br />size_t_EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t));<br />size_t_EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *));<br />#ifndef __STRICT_ANSI__<br />#ifndef _REENT_ONLY<br />char *_EXFUN(mkdtemp,(char *));<br />int_EXFUN(mkostemp,(char *, int));<br />int_EXFUN(mkostemps,(char *, int, int));<br />int_EXFUN(mkstemp,(char *));<br />int_EXFUN(mkstemps,(char *, int));<br />char *_EXFUN(mktemp,(char *) _ATTRIBUTE ((__warning__ (&quot;the use of `mktemp' is dangerous; use `mkstemp' instead&quot;))));<br />#endif<br />char *_EXFUN(_mkdtemp_r, (struct _reent *, char *));<br />int_EXFUN(_mkostemp_r, (struct _reent *, char *, int));<br />int_EXFUN(_mkostemps_r, (struct _reent *, char *, int, int));<br />int_EXFUN(_mkstemp_r, (struct _reent *, char *));<br />int_EXFUN(_mkstemps_r, (struct _reent *, char *, int));<br />char *_EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ (&quot;the use of `mktemp' is dangerous; use `mkstemp' instead&quot;))));<br />#endif<br />_VOID_EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar));<br />int_EXFUN(rand,(_VOID));<br />_PTR_EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));<br />#ifndef __STRICT_ANSI__<br />_PTR_EXFUN(reallocf,(_PTR __r, size_t __size));<br />char *_EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path));<br />#endif<br />_VOID_EXFUN(srand,(unsigned __seed));<br />double_EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR));<br />double_EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR));<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />float_EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR));<br />#endif<br />#ifndef __STRICT_ANSI__<br />/* the following strtodf interface is deprecated...use strtof instead */<br /># ifndef strtodf <br />#  define strtodf strtof<br /># endif<br />#endif<br />long_EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />long_EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base));<br /><br />int_EXFUN(system,(const char *__string));<br /><br />#ifndef __STRICT_ANSI__<br />long    _EXFUN(a64l,(const char *__input));<br />char *  _EXFUN(l64a,(long __input));<br />char *  _EXFUN(_l64a_r,(struct _reent *,long __input));<br />int_EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg));<br />#endif /* ! __STRICT_ANSI__ */<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />_VOID_EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__)));<br />#endif<br />#ifndef __STRICT_ANSI__<br />int_EXFUN(putenv,(char *__string));<br />int_EXFUN(_putenv_r,(struct _reent *, char *__string));<br />_PTR_EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t));<br />int_EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));<br />int_EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));<br /><br />char *_EXFUN(gcvt,(double,int,char *));<br />char *_EXFUN(gcvtf,(float,int,char *));<br />char *_EXFUN(fcvt,(double,int,int *,int *));<br />char *_EXFUN(fcvtf,(float,int,int *,int *));<br />char *_EXFUN(ecvt,(double,int,int *,int *));<br />char *_EXFUN(ecvtbuf,(double, int, int*, int*, char *));<br />char *_EXFUN(fcvtbuf,(double, int, int*, int*, char *));<br />char *_EXFUN(ecvtf,(float,int,int *,int *));<br />char *_EXFUN(dtoa,(double, int, int, int *, int*, char**));<br />int_EXFUN(rand_r,(unsigned *__seed));<br /><br />double _EXFUN(drand48,(_VOID));<br />double _EXFUN(_drand48_r,(struct _reent *));<br />double _EXFUN(erand48,(unsigned short &#91;3&#93;));<br />double _EXFUN(_erand48_r,(struct _reent *, unsigned short &#91;3&#93;));<br />long   _EXFUN(jrand48,(unsigned short &#91;3&#93;));<br />long   _EXFUN(_jrand48_r,(struct _reent *, unsigned short &#91;3&#93;));<br />_VOID  _EXFUN(lcong48,(unsigned short &#91;7&#93;));<br />_VOID  _EXFUN(_lcong48_r,(struct _reent *, unsigned short &#91;7&#93;));<br />long   _EXFUN(lrand48,(_VOID));<br />long   _EXFUN(_lrand48_r,(struct _reent *));<br />long   _EXFUN(mrand48,(_VOID));<br />long   _EXFUN(_mrand48_r,(struct _reent *));<br />long   _EXFUN(nrand48,(unsigned short &#91;3&#93;));<br />long   _EXFUN(_nrand48_r,(struct _reent *, unsigned short &#91;3&#93;));<br />unsigned short *<br />       _EXFUN(seed48,(unsigned short &#91;3&#93;));<br />unsigned short *<br />       _EXFUN(_seed48_r,(struct _reent *, unsigned short &#91;3&#93;));<br />_VOID  _EXFUN(srand48,(long));<br />_VOID  _EXFUN(_srand48_r,(struct _reent *, long));<br />#endif /* ! __STRICT_ANSI__ */<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />long long _EXFUN(atoll,(const char *__nptr));<br />#endif<br />#ifndef __STRICT_ANSI__<br />long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr));<br />#endif /* ! __STRICT_ANSI__ */<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />long long _EXFUN(llabs,(long long));<br />lldiv_t_EXFUN(lldiv,(long long __numer, long long __denom));<br />long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />#endif<br />#ifndef __STRICT_ANSI__<br />long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />#endif /* ! __STRICT_ANSI__ */<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base));<br />#endif<br />#ifndef __STRICT_ANSI__<br />unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));<br /><br />#ifndef __CYGWIN__<br />_VOID_EXFUN(cfree,(_PTR));<br />int_EXFUN(unsetenv,(const char *__string));<br />int_EXFUN(_unsetenv_r,(struct _reent *, const char *__string));<br />#endif<br /><br />#ifdef __rtems__<br />int _EXFUN(posix_memalign,(void **, size_t, size_t));<br />#endif<br /><br />#endif /* ! __STRICT_ANSI__ */<br /><br />char *_EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));<br />#ifndef __CYGWIN__<br />_PTR_EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t));<br />_PTR_EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t));<br />_VOID_EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR));<br />_PTR_EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t));<br />_VOID_EXFUN(_mstats_r,(struct _reent *, char *));<br />#endif<br />int_EXFUN(_system_r,(struct _reent *, const char *));<br /><br />_VOID_EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));<br /><br />/* On platforms where long double equals double.  */<br />#ifdef _HAVE_LONG_DOUBLE<br />#if !defined(__STRICT_ANSI__) || \<br />  (defined(__STDC_VERSION__) &amp;&amp; __STDC_VERSION__ &gt;= 199901L) || \<br />  (defined(__cplusplus) &amp;&amp; __cplusplus &gt;= 201103L)<br />extern long double strtold (const char *__restrict, char **__restrict);<br />#endif<br />#endif /* _HAVE_LONG_DOUBLE */<br /><br />_END_STD_C<br /><br />#endif /* _STDLIB_H_ */[/syntax]<br /><br />Moje pytanie jest następujące. Jak sobie z tym poradzić ? Czy jest może jakiś zamiennik tej funkcji w CooCox w jakiejś innej bibliotece. <br /><br />Z góry dziękuję za pomoc <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1309">TomTea</a> — 3 mar 2015, o 16:59</p><hr />
]]></content>
</entry>
</feed>