William "Chops" Westfield escreveu: > On Jun 14, 2009, at 8:21 AM, Isaac Marino Bavaresco wrote: > > = >> This is basic, usually the designer must ensure only one task uses = >> each >> resource (serial port, etc.) at any given time (just one task use each >> resource ever or using a mutex/open, close, etc.). >> = > > Which designer are YOU talking about? I'm claiming that the designer The system designer, Solarwind in this case. The RTOS author did a lot of work in this area already, supplying us with nice mutexes, semaphores and queues. > = > of the C18 libraries is unlikely to have taken into account all = > possible implementations of the multitasking operating systems that = > might run on the same software, and so the C18 library itself is VERY = > unlikely to be "thread safe" in most of its functions. This is why = > = I found that the MPLAB-C18 library programmers did a good job in making most of the library functions reentrant. Just a little more work and we have a working system. > operating systems tend to implement the critical bits of I/O and etc = > as "system calls" rather than library functions. If you want serial I/ = > O from multiple freeRTOS tasks to 'work' (you pick the definition of = > "work", Solarwind said "all of the characters show up, perhaps = > intermixed", which sounds pretty good), then you need serial IO = > functions written specifically to work with FreeRTOS, not the = > functions that came as a convenience feature with some random compiler. > > BillW For my systems, I wrote myself a complete framework to access hardware under FreeRTOS. I created open/close, read/write, etc. functions that deal with multiple tasks trying to use serial ports, etc. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist