cc2530脉冲T1—控led

#include "iocc2530.h"
#define LED1 P1_0
void io_init(void){
    CLKCONCMD &=~0X80;
    PERCFG |=0X40;
    P1SEL |=0X01;
    P1DIR |=0X01;
}
void t1_init(void){
    T1CC0L =0X00;
    T1CC0H =0XF0;
    
    T1CCTL2 =0X24;
    T1CC2L =0X00;
    T1CC2H =0X70;
    
    T1CTL =0X0F;
    TIMIF &=~0X40;
    T1IE =1;
    EA=1;
}
#pragma vector =T1_VECTOR
__interrupt void t1_1(void){
    LED1=~LED1;
    T1STAT &=~(1<<2);
    T1STAT &=~(1<<5);
    T1IF=0;
}
void main(void){
    io_init();
    t1_init();
    while(1){
      
    }
} 

你可能感兴趣的:(算法)