Ejemplo n.º 1
0
/*FUNCTION*********************************************************************
 *
 * Function Name : dbg_console_cm_callback
 * Description   : debug console callback for change event from power manager
 *
 *END*************************************************************************/
clock_manager_error_code_t dbg_console_cm_callback(clock_notify_struct_t *notify,
     void* callbackData)
{
    clock_manager_error_code_t result = kClockManagerSuccess;

    switch (notify->notifyType)
    {
        case kClockManagerNotifyBefore:     // Received "pre" message
            DbgConsole_DeInit();
        break;

        case kClockManagerNotifyRecover: // Received "recover" message
        case kClockManagerNotifyAfter:    // Received "post" message
            if (CLOCK_VLPR == CLOCK_SYS_GetCurrentConfiguration())
            {
                CLOCK_SYS_SetLpuartSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpuartSrcMcgIrClk);
            }
            else
            {
                CLOCK_SYS_SetLpuartSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpuartSrcMcgFllClk);
            }
            DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD, kDebugConsoleLPUART);
        break;

        default:
            result = kClockManagerError;
            break;
    }
    return result;
}
Ejemplo n.º 2
0
/*******************************************************************************
 * Callback function for Clock Manager.
 ******************************************************************************/
clock_manager_error_code_t clockManagerCallback(clock_notify_struct_t *notify,
                                    			void* callbackData)
{
    clock_manager_error_code_t ret = kClockManagerError;

    switch (notify->notifyType)
    {
        case kClockManagerNotifyBefore:
            DbgConsole_DeInit();
            ret = kClockManagerSuccess;
            break;
            
        case kClockManagerNotifyRecover:
        case kClockManagerNotifyAfter:
        	DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD,
        	            	kDebugConsoleUART);
        	ret = kClockManagerSuccess;
            break;
            
        default:
            break;
    }
    
    return ret;
}
Ejemplo n.º 3
0
/*
 * Callback for debug console.
 * Debug console may use UART or LPUART for different platforms, so there
 * should be callback for UART or LPUART, to simplify the unit test, here
 * call DbgConsole_Init/DbgConsole_DeInit in callback function, because
 * DbgConsole_xxx could access the proper IP.
 */
clock_manager_error_code_t debugCallback(clock_notify_struct_t *notify,
                                    void* callbackData)
{
    clock_manager_error_code_t result = kClockManagerSuccess;

    switch (notify->notifyType)
    {
        case kClockManagerNotifyBefore:     // Received "pre" message
            DbgConsole_DeInit();
            break;
        case kClockManagerNotifyRecover: // Received "recover" message
        case kClockManagerNotifyAfter:    // Received "post" message
            dbg_uart_reinit();
            break;
        default:
            result = kClockManagerError;
            break;
    }
    return result;
}
Ejemplo n.º 4
0
/*FUNCTION*********************************************************************
 *
 * Function Name : dbg_console_cm_callback
 * Description   : debug console callback for change event from power manager
 *
 *END*************************************************************************/
clock_manager_error_code_t dbg_console_cm_callback(clock_notify_struct_t *notify,
     void* callbackData)
{
    clock_manager_error_code_t result = kClockManagerSuccess;

    switch (notify->notifyType)
    {
        case kClockManagerNotifyBefore:     // Received "pre" message
            DbgConsole_DeInit();
        break;

        case kClockManagerNotifyRecover: // Received "recover" message
        case kClockManagerNotifyAfter:    // Received "post" message
            DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD, kDebugConsoleUART);
        break;

        default:
            result = kClockManagerError;
            break;
    }
    return result;
}