cho em hỏi về ngắt timer0

Collapse
X
 
  • Giờ
  • Show
Clear All
new posts
  • thaibinh113
    Thành viên mới
    • May 2012
    • 2

    #1

    cho em hỏi về ngắt timer0

    e không hiểu đoạn code này...ai có thể giúp e giải thích được không
    PHP Code:
    void timer0_config()
    {
    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256|RTCC_8_BIT);      //   T_tm0=T_osc*4*256
    enable_interrupts(INT_TIMER0);   //Cho phep ngat tran timer0 hoat dong
    
    }
    
    //****************************************************************************//
    // Ngat Timer 0 De lay Gia Tri Time
    #INT_RTCC            
    void  ngat_timer0(void) 
    {
     set_timer0(2); 
       Count++;
       if(Count==46)
       {
       // dinh thoi 0.5s
       disable_interrupts(GLOBAL); 
       Count=0;                                 
       if(time==99) time=0; 
       else time++;
       enable_interrupts(GLOBAL);
       }
    } 
    

Về tác giả

Collapse

thaibinh113 Tìm hiểu thêm về thaibinh113

Bài viết mới nhất

Collapse

Đang tải...