led.c

来自「基于DSPTMS320C5416的指示灯延迟程序」· C语言 代码 · 共 58 行

C
58
字号

#include "ledcfg.h"
#include "dsk5416.h"
#include "dsk5416_led.h"

/*
 *    Blink0() - This task blinks LED #0
 */
 
void Blink0()
{
    int delay;
    
    // Set delay between LED transitions
    delay = 500;
    
    // Blink LED #0
    while(1)
    {
        // Turn the LED on
        DSK5416_LED_on(0);
        TSK_sleep(delay);
        
        // Turn the LED off
        DSK5416_LED_off(0);
        TSK_sleep(delay); 
    }   
}


/*
 *    Blink3() - This task blinks LED #3
 */
 
void Blink3()
{
    // Set delay between LED transitions
    int delay = 100;
    
    // Blink LED #3
    while(1)
    {
        // Turn the LED on
        DSK5416_LED_on(3);
        TSK_sleep(delay);
        
        // Turn the LED off
        DSK5416_LED_off(3);
        TSK_sleep(delay); 
    }
}

void main()
{
    // Initialize the board support library
    DSK5416_init();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?