Tool/software: TI-RTOS
Hi TI experts,
Successfully, I installed and generated the SCS code for UART emulation.
So, when receiving a data from PC, it sends back to PC.
My question is how to signal the receiving event to APP MCU instead of PC.
My understanding is that scTaskAlertCallback is called to generate the signal by using 'Semaphore_post'.
But, I don't know how to link with an event in APP CPU. I am still not familiar with the signalling.
Should I add or modify something in scTaskAlertCallback() ?
void scTaskAlertCallback(void) {
// Wake up the OS task
Semaphore_post(Semaphore_handle(&semScTaskAlert));
} // scTaskAlertCallback
typedef struct
{
uint8_t event; // Sensor Controller events
uint16_t data; // UART data
} uartEvt_t;
static void SimpleBLECentral_scUART_enqueueMsg(uint8_t event, uint8_t data)
{
uartEvt_t *pMsg;
// Create dynamic pointer to message.
if (pMsg = ICall_malloc(sizeof(uartEvt_t)))
{
pMsg->event = event;
pMsg->data = data;
// Enqueue the message.
Util_enqueueMsg(appMsgQueue, syncEvent, (uint8*)pMsg);
}
}
void SimpleBLECentrall_scUartTransferHandler(uint8 data)
{
SimpleBLECentral_scUART_enqueueMsg(SBC_UART_EVT, data);
}
static void SimpleBLECentral_processAppMsg(hbcEvt_t *pMsg)
{
switch (pMsg->hdr.event)
{
case SBC_STATE_CHANGE_EVT:
SimpleBLECentral_processStackMsg((ICall_Hdr *)pMsg->pData);
// Free the stack message
ICall_freeMsg(pMsg->pData);
break;
case SBC_UART_EVT:
SimpleBLECentral_processUART( ((uartEvt_t*)pMsg)->data);
break;
default:
// Do nothing.
break;
}
}
static void SimpleBLECentral_processUART(uint16_t data)
{
Display_printf(dispHandle, 6, 0, "UART data: %x", data);
}
BR,
Ji Won