mled.c
来自「可以在TI5416DSP上运行的I/O端口操作程序」· C语言 代码 · 共 47 行
C
47 行
ioport unsigned int port3002;
void Delay(int nDelay);
void ShiftToLeftAndRight(unsigned int nInit);
main()
{
for(;;)
{
ShiftToLeftAndRight(1);
ShiftToLeftAndRight(3);
ShiftToLeftAndRight(7);
ShiftToLeftAndRight(15);
}
}
void Delay(int nDelay)
{
int i,j,k;
k=0;
for ( i=0;i<nDelay;i++ )
for ( j=0;j<1024;j++ )
k++;
}
void ShiftToLeftAndRight(unsigned int nInit)
{
unsigned int uWork;
int i;
uWork=nInit;
port3002=~uWork;
for ( i=0;i<6;i++ )
{
Delay(256);
uWork<<=1;
port3002=~uWork;
}
for ( i=0;i<6;i++ )
{
Delay(256);
uWork>>=1;
port3002=~uWork;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?