blinkdsk6416.c

来自「基于ti 6416dsk的flashburn程序。」· C语言 代码 · 共 63 行

C
63
字号
/*******************************************************************************
 * Copyright 2004-2005 - Software Design Solutions, Inc.  All rights reserved.
 *
 * Portions of this work have been provided under license with Texas 
 * Instruments Inc.
 * 
 * $RCSfile: BlinkDSK6416.c,v $
 * $Revision: 1.2 $
 * 
 * Blink example for FlashBurn
 ******************************************************************************/

#include "c6416dsk.h"
#include "cpld.h"
#include "timer.h"


/* Main function, initializes and loops, blinking the LEDs
 */
void main( void )
{   
    int i;
    
    CSL_init();
	
    /* DSP initialization */
    IRQ_globalDisable();
    for(i = 0; i < 32; i++)
    {
        IRQ_disable(i);   /* Disable and clear all IRQ events */
        IRQ_clear(i);     /* except reset and NMI interrupts */
    }

    EMIF_Init();
    TIMER_Init();
    
    CPLD_LedOff(LED_ALL);
    TIMER_DelayMsec(100);
    CPLD_LedOn(LED_ALL);
    TIMER_DelayMsec(500);
    
    // Very simple Led test.  Turn them all off then on
    // one at a time, then off one at a time.
    CPLD_LedOff( LED_ALL );
    
    for( ; ; )
    {
        for(i = 0; i < LED_AVAILABLE; i++)
        {
            CPLD_LedOn(LED_0 << i);
            TIMER_DelayMsec(100);
        }
        
        for(i = 0; i < LED_AVAILABLE; i++)
        {
            CPLD_LedOff(LED_0 << i);
            TIMER_DelayMsec(100);	    	
        }
    
        TIMER_DelayMsec(500);	    	
    }
}

⌨️ 快捷键说明

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