Example #1
0
bool _SYS_DEBUG_INIT(int debug_port)
{
    _SYS_CDEV_ENTRY* pEntry;
    bool init_res;

    pEntry = _SysGetCDevEntry(debug_port);

    if(pEntry == 0)
    {   // no such entry
        return false;
    }

    init_res = (*pEntry->pObj->init)(pEntry->port_no, SYS_DEBUG_BAUDRATE);

    // perform also the _SYS_DEBUG_OPEN() here so that the system calls
    // directly debug services without a handle
    if(init_res)
    {
        debug_handle = (_SYS_CDEV_ENTRY*)_SYS_DEBUG_OPEN(debug_port);
        return debug_handle != 0;
    }

    return false;

}
Example #2
0
bool _SYS_DEBUG_INIT(int debug_port)
{
    bool initRes = USART_INIT(debug_port, SYS_DEBUG_BAUDRATE);
    if(initRes)
    {
        debug_handle = _SYS_DEBUG_OPEN(debug_port);
        return debug_handle != 0;
    }

    return false;
}