nxp-mcuxpresso / rpmsg-lite

RPMsg implementation for small MCUs
BSD 3-Clause "New" or "Revised" License
241 stars 74 forks source link

Replace env_init_counter with something like event group #16

Open Hadatko opened 3 years ago

Hadatko commented 3 years ago

Hi @MichalPrincNXP, from what i see in code i would say that env_init_counter<0 is dead code and rest of code can be rewrtiten to bool logic. Recently i got a knowledge that for global bool knowledge should be used something like https://www.freertos.org/event-groups-API.html.

I may create PR with suggested code if you agree with me. I am talking about rpmsg_env_freertos.c file.

MichalPrincNXP commented 3 years ago

Sorry, I do not see the weakpoint, I guess using event group would consume a little more RAM. Anyway, your suggestions are welcome.

Hadatko commented 3 years ago

We were informed that good practice is to replace global bool variables with mutexes. Groups consumes less resources than mutexes.