1st) thank you for FreeRTOS, it’s amazing!
2nd) thanks to Joao Melo for his demo configured to run on the Pic32 Ethernet Starter Kit (link here
I would like to see some stats, and have been reading the defines I have to make, which are missing in the Pic32 port.
But I’m not clear on what the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE() should do.
Should I configure the first to setup a free timer on the micro, possibly running 100x faster then the main timer?
And then what value should the second macro report? I don’t think the raw timer value would be sufficient, even if it were a 16bit timer. But it would roll over very quickly.
Can you please clarify it a bit?
I’m (slowly) working on getting the Microchip USB stack working in a task.
Right now the CDC part is working.
But I would really like to use some printf style functions, is there a way I can point the default printf to use a function of mine to output the final chars? I’ve had a look at fprintf and the likes but I’m not sure on how to *create* another stream.
If I get the custom putc/getc functions, they would be executed in the task stack space.
That means that should a semaphore variable exist, the code could check (for security of concurrence) that the calling task had the semaphore before attempting to send data.
But I haven’t found a way to check who’s got possesion of the token in binary semaphores. There are only give and take funcs, but it should be possible (in my opinion) to know if I have it or not. How could I do it?
6th) much more general: in a preemptive env, why aren’t there signals to send to the tasks?
Tasks can block on sempahores and queues but it seems to me that a signal would really simplify things in some cases.
For example in higher level tasks (say app layer) you could wait for a lower level task to get a complete message for you (like a tcpip stack) but then how would the lower level task notify you? putting the message in a queue?
In a tcp style case, it would be very inefficient: what size would you allow for each queue memeber?
Also how could all the higher level tasks check if the message is for them or not?
It seems to me that a signaling system could really simplify such occasions.