Start Task StartTask () sends out the message queue itself to delete, the receiver has been displaying data with Osqflush (STR_Q); Empty the message queue under the tangle can't receive haha

Source: Internet
Author: User
  • In the establishment of the project, the start Task StartTask () started the task MyTask (), also set up a message queue, and then send a message queue, send out their own deleted themselves, the receiver has been able to receive data??? Why???

Because our message queue is not emptied, there is always data in the message queue, of course, in the execution of MyTask's task, mytask inside has this sentence waiting for message queue ss=osqpend (STR_Q,0,&ERR); Request Message Queue, if inside the task MyTask we clear message queue tender? Ah, is there no data to receive??? Sure,,, after emptying nothing to receive ...

StartTask () Start the task program:

S100= "The value of Ostime is from now!!";
Pc_dispchar (0x80, 0, showtable[1], 0);
Osqpostfront (str_q,s100); Send

MyTask of the program:

Osqflush (STR_Q); Empty the message queue under the tangle can't receive haha

Ss=osqpend (Str_q,0,&err); Request Message Queue Request There's no bird, nothing.

Pc_dispstr (3,++y,ss,disp_fgnd_red+disp_bgnd_light_gray); Easy Arm software value to receive data once

Results: With Zlg's easy ARM display, nothing is displayed.

Start Task StartTask () sends out the message queue itself to delete, the receiver has been displaying data with Osqflush (STR_Q); Empty the message queue under the tangle can't receive haha

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.