📄 serialconsolestdio_comp.c
字号:
/*
* Copyright (c) 1999 by TriMedia Technologies.
*
* +------------------------------------------------------------------+
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such |
* | a license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided|
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | this code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +------------------------------------------------------------------+
*
* Module name : SerialConsoleStdio_Comp.c 1.5
*
*
* Last update : 08:15:10 - 99/04/16
*
* Description : Component for opening
* standard io streams on
* simple serial IO driver
*
*/
#include <tm1/tsaComponent.h>
#include <tm1/tmLibdevErr.h>
#include <tmlib/HostCall.h>
#include "IOComponents.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <tmlib/dprintf.h>
static tmLibdevErr_t activate(pcomponent_t comp)
{
_open(CONSOLE, O_RDONLY, 0666);
_open(CONSOLE, O_WRONLY | O_CREAT | O_TRUNC, 0666);
_open(CONSOLE, O_WRONLY | O_CREAT | O_TRUNC, 0666);
IDENTIFY(SerialConsoleStdio);
return TMLIBDEV_OK;
}
TSA_COMP_DEF_IO_COMPONENT(SerialConsoleStdio,
TSA_COMP_BUILD_ARG_LIST_1(ID(SerialConsoleDriver)),
TSA_COMP_BUILD_ARG_LIST_1(ID(SerialConsoleStdio)),
activate);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -