Im working with the TI Z-Stack znp-project and implement a own functions in a separate file (bc.c
+ bc.h
). Although I'm fresh to C I managed all fine except one thing:
in the file znp_app.c
I need to reference a queue for uart-tx-ing:
static osal_msg_q_t npTxQueue;
to achieve what I now wrote in the znp_app.c
in my own bc.c
(where I include znp_app.h
).
void bc_sendResponse(...) // in bc.c
{
...
npSendForBc(bcMSGp); // want to call "osal_msg_enqueue(&npTxQueue, pBuf);" here
...
}
void npSendForBc(uint8 *pBuf) // workaround function in znp_app.c
{
osal_msg_enqueue(&npTxQueue, pBuf); // need this in bc.c
}
I tried to define the queue in the znp_app.h
, but the compiler don't appreciates it.
I also tried do write some kind of "getter", but it also was not supported.
Please show me the correct syntax, ty.
EDIT 1
I already tried to
extern osal_msg_q_t npTxQueue; // in znp_app.h
but I get this error while linking:
error: Error[e46]: Undefined external "npTxQueue" referred in bc ( C:\...\Z-Stack 3.0.1\Projects\zstack\ZNP\CC253x\CC2531-ZNP-with-SBL\Obj\bc.r51 )
As getter I tried (with an extern in znp_app.h
)
osal_msg_q_t getQueues()
{
return npTxQueue;
}
I cant exactly remember the error code.