s1l5.c

来自「《DSP系统入门与实践》」· C语言 代码 · 共 44 行

C
44
字号
/*********************************************************************
 * S1L5.c - (Section 1, Lesson 5) RECEIVING AN ARRAY OF INTEGERS FROM
 *                                THE HOST
 *          This is the RTDX Target Code for Section 1, Lesson 5
 *
 * This example receives integer values 1-10 from the host
 ********************************************************************/

#include "target.h"     /* defines TARGET_INITIALIZE()              */
#include <stdio.h>      /* C_I/O                                    */

/* declare a global input channel                                   */

 
void main()
{
        int arraydata[10];
        int status,i;

       

        /* enable the input channel                                 */
        
 
        /*************************************************************
         * Insert code from Step #2 here - to request an array of
         *                                 integers
         *
         ************************************************************/


        if ( status != sizeof(arraydata) ) {
                printf( "ERROR: RTDX_read failed!\n" );
                exit( -1 );
        } else
                for( i = 0; i < ( sizeof(arraydata) / sizeof(int) ); i++)
                        printf( "Value %d was received from the host\n",
                                arraydata[i] );

        /* disable the input channel                                */
       
        printf( "Program Complete!\n" );
}

⌨️ 快捷键说明

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