I would like to use the app_easy_msg API to send a message from an ISR to the application task (to trigger execution of code that is too long to include in an ISR). The app_easy_msg_utils files show how to register a callback and get the message identifier, but there is no function to send the message. I did not see this API used in any of the example projects. Is there an example somewhere of how to use app_easy_msg to actually send the message?
Also, it would be nice if the callback could take a pointer to parameters (which would be sent with the message). I don't see any way to do this without hacking the app_easy_msg_utils.c file, so it's probably easier to just use global variables to pass information to the callback, but certainly not the preferred method.
If there is a better way to send a message from an ISR to the TASK_APP task (possibly to be handled in the user_catch_rest_hndl() function) then please explain. Thanks!
Hi mkelwood,
从app_e app_easy_msg实用程序使用asy_wakeup implementation, so in order to set a custom message you should do the following:
If you are using the app_easy_msg_utilities() in order to send custom messages, then the app_msg_utils_api_process_handler() will handle the messages and serve the corresponding callbacks. What you can also try is to declare a custom message in your profile for example in the custom profile and just use the ke_msg_send_basic() function in order to send it, that way you will be able to catch it, in the catch_rest handler.
Thanks MT_Dialog