Hi Sandros,
I took a slightly different approach to work with queues and see how they are working.
I started with: C:\Freescale\Freescale_MQX_4_1_Vybrid\mqx\examples\test\test.c
Borrowed code from: C:\Freescale\Freescale_MQX_4_1_Vybrid\mqx\examples\lwevent\lwevent.c
Attached is my modified test.c and BSP/user_config.h.
I tested on my TWR-VF65GS10 Rev G tower kit with TWR-SER card so that I could use the DB-9 serial interface to my terminal utility.
I am using ARM DS5 IDE and lasted Vybrid MQX as path shows above.
The project is running test_twrvf65gs10_m4 on the Cortex M4 code and not the Cortex A5.
Each pass of the code will first call " result = _lwevent_test(&error_ptr, &error2_ptr);" .
The test will check the lwevent queues so if you step into you can see that process.
The code will add lwevent as loop_cnt grows: if (_lwevent_create(&lwevent_array[loop_cnt],0) != MQX_OK)
Using DS5 I can see the OS Data Lightweight Events "Event Group*" grow as well.
After creating 11 new lwevents, the loop_cnt will decrement to 0 each loop and during that portion of the code we destroy lwevents.
Reference: if (_lwevent_destroy(&lwevent_array[loop_cnt]) != MQX_OK)
Stepping into the create and destroy code show how the queue process is being implemented.
Terminal Output:
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 0
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 1
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 2
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 3
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 4
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 5
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 6
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 7
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 8
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 9
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 10
_lwevent_test passed... _lwevent_create passed... All tests passed with loop_cnt = 10
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 9
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 8
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 7
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 6
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 5
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 4
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 3
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 2
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 1
_lwevent_test passed... _lwevent_destroy passed... All tests passed with loop_cnt = 0
Regards,
David