STM32 contiki porting level 3 (medium): timer Chinese Version

Source: Internet
Author: User

In view of their low level of English, here, I will translate the previous article on contiki timer into Chinese, so that I can learn more conveniently. There are a lot of things in this article that are not very smooth.

 

Timers

The Contiki system provides a clock library for applications and the system itself. The clock Library provides functions such as checking time exceeds, awakening the system from low-power mode to scheduled time, and real-time task scheduling. The clock is also used for applications to allow the system to work with others, or for a period of time before the recovery is executed into the low power consumption mode.

The Contiki Timer Modules

Contiki

Timer

Etimer

Ctimerthey are especially useful in any code that do not have an explicit Contiki process such as protocol implementations

Rtimer

The Clock Module

Contikiclock_time () CLOCK_SECONDclock_time_tclock_seconds ()

Clock_delay () clock_wait ()

Clock_init ()

The Timer Library

Contiki

Contiki

Timer_expired ()

Timer

Timer

Static struct timer rxtimer;

Void init (void ){

Timer_set (& rxtimer, CLOCK_SECOND/2 );

}

Interrupt (UART1RX_VECTOR)

Uartpairx_interrupt (void)

{

If (timer_expired (& rxtimer )){

/* Timeout */

/*...*/

}

Timer_restart (& rxtimer );

/*...*/

}

The Stimer Library

Contiki stki

Contiki stki

Stimer

Stimer

The Etimer Library

Contiki etimer

Contiki etimeretimer_reset ()

Related Article

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.