I am trying to implement an Fault storage and retrieval application
When the new fault occurs , I wanna be able to store the fault (This fault will be reported to fault monitoring task by any other task running in the system)
I should be able to delete the fault when the fault no longer exists
I should be able to add new faults to the list and check if the new fault already exists in the fault table .
I would like to know if I can use the FreeRTOs ring buffer for this sought of application ?
As you said you want to have a table (or list) with random access to each element and the ability to erase elements. Hence a ring buffer is by design not applicable. It’s a FIFO you can push into one end and pop from the other.
Seems you have to create your own data structure (e.g. a doubly linked list) or use e.g. std::deque - cppreference.com in case you’re using C++ maybe protected by a mutex when accessed by multiple tasks.