bool _SYS_CONSOLE_INIT(int console_port) { _SYS_CDEV_ENTRY* pEntry; bool init_res; pEntry = _SysGetCDevEntry(console_port); if(pEntry == 0) { // no such entry return false; } init_res = (*pEntry->pObj->init)(pEntry->port_no, SYS_CONSOLE_BAUDRATE); // perform also the _SYS_CONSOLE_OPEN() here so that the system calls // directly debug services without a handle if(init_res) { console_handle = (_SYS_CDEV_ENTRY*)_SYS_CONSOLE_OPEN(console_port); return console_handle != 0; } return false; }
bool _SYS_CONSOLE_INIT(int console_port) { bool initRes = USART_INIT(console_port, SYS_CONSOLE_BAUDRATE); if(initRes) { console_handle = _SYS_CONSOLE_OPEN(console_port); return console_handle != 0; } return false; }