I think if you are using another compiler such as Keil, maybe you would
just use the #define statement for these definitions in your include .h file, such as:
#define HAL_UART_ISR=TRUE
Hope this helps
###############################################################################################
###############################################################################################
Here are some really basic steps to send and receive serial I/O with TIMAC:
1. Make sure the following files are included in the project: hal_uart.c and hal_driver.c
2. Define HAL_UART=TRUE in the IDE compiler pre-processor options
3. Call HalUARTInit() in main()
4. Call HalUARTOpen() in your program -- see sample code below:
halUARTCfg_t uartConfig;
uartConfig.configured = TRUE;
uartConfig.baudRate = HAL_UART_BR_38400;
uartConfig.flowControl = TRUE;
uartConfig.flowControlThreshold = 5;
uartConfig.rx.maxBufSize = 120;
uartConfig.tx.maxBufSize = 120;
uartConfig.idleTimeout = 5;
uartConfig.intEnable = TRUE;
uartConfig.callBackFunc = MT_UartProcessRxData;
HalUARTOpen (0, &uartConfig); //0 for port 0 and 1 for port 1
5. Define a callback function MT_UartProcessRxData (defined in the call to HalUARTOpen()) somewhere in your program. This function will be called when the UART receives stuff. The user program can call HalUARTRead() here to read the buffer -- it's totally up to the user to handle the buffer here.
6. Use HalUARTWrite() to write stuff to the serial port.
#################################################################################################
#################################################################################################
MT_UartProcessRxData is the callback function for the UART.
This is what is contained in mine for reading a single character:
switch (cmdbuff[0])
{
case '1':
HalUARTWrite( SERIAL_APP_PORT, "CMD - 1\n\r", 10 ); // Echo character
break;
case 'f':
HalUARTWrite( SERIAL_APP_PORT, "CMD - f\n\r", 10 );
break;
default:
break;
}
}
This callback did not work until I set HAL_UART_ISR=TRUE and HAL_UART_DMA=FALSE. in the preprocessor directives.
Hope this helps. I know how frustrating this can be.
###################################################################################################