文档上都说 共享变量要定义在.c文件里
如
/********************************************************************
shared.h
C28x and CLA Shared Header File
********************************************************************/
typedef struct{
float a;
float b;
float c;
}foo;
/********************************************************************
main.c
Main C28x C-code Source File
********************************************************************/
#pragma(X,"CpuToCla1MsgRam") // Assign X to section CpuToCla1MsgRam
foo X;
/********************************************************************
test.cla
CLA C-code Source File
********************************************************************/
__interrupt void Cla1Task1 ( void )
{
float f1,f2;
f1 = X.a;
}
但这样就得把这个X 用extern 修饰成全局变量,但我们的工程不允许有extern, 请问有没有其他方式,不用extern,来实现cpu 与 cla的交互