tbx.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- #ifdef REPORT_TO_CONSOLE
- #include <stdio.h>
- #endif
- #include <string.h>
- #include "stdevice.h"
- #include "gendef.h"
- #include "section.h"
- #include "uart.h"
- #include "tbx.h"
- #if defined(REPORT_TO_UART)
- #define TBX_DEVICE STTBX_DEVICE_UART
- #elif defined(REPORT_TO_CONSOLE)
- #define TBX_DEVICE STTBX_DEVICE_DCU
- #else
- #error incorrect value for DVD_IO
- #endif
- /******************************************************************************
- * Local variables
- ******************************************************************************/
- ST_DeviceName_t g_KBTbxDeviceName = "TBX";
- extern ST_DeviceName_t UART_DeviceName[];
- ST_ErrorCode_t KB_TbxSetup(void)
- {
- ST_ErrorCode_t ST_ErrorCode = ST_NO_ERROR;
- STTBX_InitParams_t STTBX_InitParams;
- memset(&STTBX_InitParams, ' ', sizeof( STTBX_InitParams_t ) );
- STTBX_InitParams.SupportedDevices = TBX_DEVICE;
- STTBX_InitParams.DefaultOutputDevice = TBX_DEVICE;
- STTBX_InitParams.DefaultInputDevice = TBX_DEVICE;
- STTBX_InitParams.CPUPartition_p = SystemPartition;
- #if defined(REPORT_TO_UART)
- strcpy(STTBX_InitParams.UartDeviceName, UART_DeviceName[KB_UART_TBX_DEVICE]);
- #endif
- ST_ErrorCode = STTBX_Init(g_KBTbxDeviceName, &STTBX_InitParams );
- #ifdef REPORT_TO_CONSOLE
- if(ST_ErrorCode != ST_NO_ERROR)
- Print("nKB_TbxSetup(%s) Failed", g_KBTbxDeviceName);
- else
- Print("nKB_TbxSetup(%s) = %s", g_KBTbxDeviceName,STTBX_GetRevision());
- #endif
- return ( ST_ErrorCode );
- }
- /* EOF*/