Keil rtos rtx full timing is not allowed ???

Source: Internet
Author: User
# Pragma large # include "stc12c5a. h # include <rtx51.h> // RTX-51 definitionssbit sound = P2 ^ 3; sbit sound1 = P2 ^ 4; sbit sound2 = P2 ^ 5; void producertask (void) _ task _ 0 {OS _set_slice (1000); // 12 MHz 1 ms OS _create_task (1); // create the consumer-task OS _create_task (2); OS _create_task (3 ); OS _delete_task (0);} void task1 (void) _ task _ partition priority _ 1 {While (1) // endless loop {OS _wait (k_tmo, 5, 0); sound1 = ~ Sound1 ;}} void task2 (void) _ task _ 2 _ priority _ 1 {While (1) // endless loop {OS _wait (k_tmo, 10, 0); sound2 = ~ Sound2 ;}} void task3 (void) _ task _ 3 _ priority _ 1 {While (1) // endless loop {OS _wait (k_tmo, 1, 0); sound = ~ Sound ;}} void main (void) {signed Char rtxreturnstate; rtxreturnstate = OS _start_system (0 );}

We can see from the sound waveform that it is inaccurate.

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.