I have my application which has a hal function to invalidate cache memory. This application uses a library which needs the invalidate function.
A straight solution is to couple the application and library by including the header file and use the hal function, but this is not a cohesive application.
I am not able to think of a solution and need help. I am new to design.
In case you cannot (or not not want to) move the hal function's source code into the library, extend the library in a way it can consume a pointer to a function (either during some initialization step, or directly as a parameter of the hal function). This way, the code for the hal function will stay in the app, and the lib can call the function without having to include anything from the app.