/* Initializes the user program application. Should be called once during software program initialization.  */
void AppInit(void)
/* Initializes the user program application. Should be called once during software program initialization.  */
void AppInit(void)
{
  tTbxMbUartPort port;
  TimerInit();
  LedInit();
  port = (BOOT_COM_MBRTU_CHANNEL_INDEX == 0) ? TBX_MB_UART_PORT1 : TBX_MB_UART_PORT2;
  modbusRtuTransport = TbxMbRtuCreate(0x01, port, TBX_MB_UART_57600BPS,
                                     TBX_MB_UART_1_STOPBITS, TBX_MB_EVEN_PARITY);
  modbusServer = TbxMbServerCreate(modbusRtuTransport);
  TbxMbServerSetCallbackReadInputReg(modbusServer, AppReadInputReg);
  TbxMbServerSetCallbackCustomFunction(modbusServer, AppCustomFunctionCallback);
}