JeGy wrote:> Hi, > > does anyone here know > if the IAR AVR C-compiler sprintf() and associated functions > are thread safe in in multi-tasking, e.i. FreeRTOS? > > Regards > > JensSorry I didn't think of checking this when you first posted. I checked the source, none of the printf variants in the IAR libraries are thread safe, this includes sprintf. -- Scott
Thread safe printf?
Started by ●December 18, 2008
Reply by ●December 22, 20082008-12-22
Reply by ●December 22, 20082008-12-22
"Not Really Me" <scott@validatedQWERTYsoftware.XYZZY.com> wrote in message news:6r9q9gF5k0vU1@mid.individual.net...> JeGy wrote: >> Hi, >> >> does anyone here know >> if the IAR AVR C-compiler sprintf() and associated functions >> are thread safe in in multi-tasking, e.i. FreeRTOS? >> >> Regards >> >> Jens > > Sorry I didn't think of checking this when you first posted. I checked > the source, none of the printf variants in the IAR libraries are thread > safe, this includes sprintf.According to their AVR compiler documentation their sprintf() implementation is thread safe - so it is interesting if your inspection shows otherwise. The FreeRTOS download includes a mini implementation of sprintf() that is thread safe. I normally use that regardless as it uses much less stack than standard library variants. -- Regards, Richard. + http://www.FreeRTOS.org Designed for microcontrollers. More than 7000 downloads per month. + http://www.SafeRTOS.com Certified by T�V as meeting the requirements for safety related systems.