?? s4l6.c
字號:
/*********************************************************************
* S4L6.c - (Section 4, Lesson 6) USING THE SETPROCESSOR ROUTINE
* This is the RTDX Target Code for Section 4, Lesson 6
*
* This example sends integer value 5 to the host
********************************************************************/
/*********************************************************************
* Insert code from Step #2 here - to include the rtdx header file,
* which defines the RTDX target API
********************************************************************/
#include <rtdx.h> /* defines RTDX target API calls */
#include "target.h" /* defines TARGET_INITIALIZE() */
#include <stdio.h> /* C_I/O */
/* This is are the value we are going to send to the host */
#define VALUE_TO_SEND 5
/* declare a global output channel */
RTDX_CreateOutputChannel( ochan );
void main()
{
int data = VALUE_TO_SEND;
int status;
TARGET_INITIALIZE();
/* enable the output channel */
RTDX_enableOutput( &ochan );
/* send the data to the host */
status = RTDX_write( &ochan, &data, sizeof(data) );
if ( status == 0 ) {
puts( "ERROR: RTDX_write failed!\n" );
exit( -1 );
}
while ( RTDX_writing != NULL ) {
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll();
#endif
}
/* disable the output channel */
RTDX_disableOutput( &ochan );
puts( "Program Complete!\n" );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -