void applicationTask()
{
if (UART_Rdy_Ptr())
{
rxDat = UART_Rd_Ptr();
chPtr = &txd[0];
switch (rxDat)
{
case '1' :
{
_strcpy( chPtr, &txtMessage1[0] );
MCP2518FD_transmitMessage( 5, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '2' :
{
_strcpy( chPtr, &txtMessage2[0] );
MCP2518FD_transmitMessage( 7, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '3' :
{
_strcpy( chPtr, &txtMessage3[0] );
MCP2518FD_transmitMessage( 2, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '4' :
{
_strcpy( chPtr, &txtMessage4[0] );
MCP2518FD_transmitMessage( 4, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '5' :
{
_strcpy( chPtr, &txtMessage5[0] );
MCP2518FD_transmitMessage( 3, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '6' :
{
_strcpy( chPtr, &txtMessage6[0] );
MCP2518FD_transmitMessage( 3, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
case '7' :
{
_strcpy( chPtr, &txtMessage7[0] );
MCP2518FD_transmitMessage( 7, &checkFlag, &txd[0] );
if (checkFlag == 1)
{
mikrobus_logWrite( "Message Sent", _LOG_LINE );
}
break;
}
default :
{
break;
}
}
}
MCP2518FD_receiveMessage( &checkFlag, &rxd[0] );
if (checkFlag == 1)
{
chPtr = &rxd[0];
mikrobus_logWrite( "Received Message : ", _LOG_TEXT );
mikrobus_logWrite( chPtr, _LOG_LINE );
}
}
|