|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 cjsb37 于 2013-4-29 09:12 编辑
我按照书上的原码,编译无错误,经主机调试,证明通道也打开了,就是传不了数据,哪位高手帮帮忙啊!
Watch Windows里面出现一项提示:
pvBuf 0x00000000 void * hex
(*pvBuf) cannot load from non-primitive location dec
不知是什么意思?有谁知道的能告诉小弟一下吗,小弟还没入门,请大家指教啊!
源程序: 目标机程序
#include <rtdx.h> /* defines RTDX target API calls */
#include "target.h" /* defines TARGET_INITIALIZE() */
#include <stdio.h> /* C_I/O */
/* This is the value we are going to send to the host */
#define VALUE_TO_SEND 500
/* declare a global output channel */
RTDX_CreateOutputChannel( ochan );
RTDX_CreateInputChannel(ichan);
void main()
{
int data;
int status;
TARGET_INITIALIZE();
/* enable output channel */
RTDX_enableOutput( &ochan );
RTDX_enableOutput( &ichan );
/* send an integer to the host */
// status = RTDX_write( &ochan, &data, sizeof(data) );
status = RTDX_read( &ichan, &data,3);
if ( status == 0 ) {
puts( "ERROR: RTDX_write failed!\n" );
exit( -1 );
}
else
printf("%d",data);
while ( RTDX_writing != NULL ) {
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll();
#endif
}
/* disable the output channel */
RTDX_disableOutput( &ochan );
RTDX_disableInput( &ichan );
puts( "rogram Complete!\n" );
}
|
|