Hi All,
This is Mahesh. I have a very basic problem while copy a character to integer. I have written windows side c# application to communicate with ek lm4f120xl board. I am sending 1 to 10 numbers from windows application to UART .
After receiving the number(char) using ROM_UARTCharGetNonBlocking(UART0_BASE) API. I want to convert this char to integer to use in switch statement. But I am unable to do that.
CodeComposer Studio is giving the following error for the following line
command = (unsigned char *)cmmd[0];
#515-D a value of type "unsigned char *" cannot be assigned to an entity of type "unsigned long"
CCS is not executing this line. Please help on this how to convert unsigned char to unsigned long
void
UARTIntHandler(void)
{
unsigned long ulStatus;
unsigned long command;
unsigned char cmmd[1] = {0};
//
// Get the interrrupt status.
//
ulStatus = ROM_UARTIntStatus(UART0_BASE, true);
//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART0_BASE, ulStatus);
//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART0_BASE))
{
cmmd[0] = ROM_UARTCharGetNonBlocking(UART0_BASE);
command = (unsigned char *)cmmd[0];
switch(command)
{
case 1: command =100;
}
}
Please help me on this.
Thanks