BOOL I2C_Internal_Uninitialize()
{
    NATIVE_PROFILE_HAL_PROCESSOR_I2C();
    
    CPU_INTC_DeactivateInterrupt(I2Cx_EV_IRQn);
    CPU_INTC_DeactivateInterrupt(I2Cx_ER_IRQn);
    I2Cx->CR1 = 0; // disable peripheral
    RCC->APB1ENR &= ~RCC_APB1ENR_I2CxEN; // disable I2C clock
    
    return TRUE;
}
BOOL AT91_GPIO_Driver::Uninitialize()
{
    GLOBAL_LOCK(irq);

    // uninitialize the interrupt information
    {
        UINT32 volatile trash;
        int i;

#if !defined(PLATFORM_ARM_SAM7_ANY)
        PIN_ISR_DESCRIPTOR* pinIsr = g_AT91_GPIO_Driver.m_PinIsr;
        for(i = 0; i < c_MaxPins; i++)
        {
            pinIsr->m_completion.Abort();

            pinIsr++;
        }
#endif

        for(i = 0; i < c_MaxPorts; i++)
        {
            AT91_PIO& pPioX = AT91::PIO(i);
            pPioX.PIO_IDR   = 0xffffffff;           // Disable all interrupts
            trash           = pPioX.PIO_ISR;        // flush pending
        }
    }

    if(!CPU_INTC_DeactivateInterrupt( AT91C_ID_PIOA )) return FALSE;
#if (AT91_MAX_GPIO > 32)
    if(!CPU_INTC_DeactivateInterrupt( AT91C_ID_PIOB )) return FALSE;
#endif 

#if (AT91_MAX_GPIO > 64)
    if(!CPU_INTC_DeactivateInterrupt( AT91C_ID_PIOC )) return FALSE;
#endif

    // TODO: will be replaced by PMC API

    AT91_PMC &PMC = AT91::PMC();
    PMC.DisablePeriphClock(AT91C_ID_PIOA);
#if  (AT91_MAX_GPIO > 32)
    PMC.DisablePeriphClock(AT91C_ID_PIOB);
#endif

#if (AT91_MAX_GPIO > 64)
    PMC.DisablePeriphClock(AT91C_ID_PIOC);
#endif

    return TRUE;
}
Beispiel #3
0
BOOL LPC24XX_GPIO_Driver::Uninitialize()
{
    GLOBAL_LOCK(irq);

    // uninitialize the interrupt information
    {
        PIN_ISR_DESCRIPTOR* pinIsr = g_LPC24XX_GPIO_Driver.m_PinIsr;
        LPC24XX_GPIOIRQ& GPIOIRQ = LPC24XX::GPIOIRQ();

        for(int i = 0; i < c_MaxPins; i++)
        {
            pinIsr->m_completion.Abort();

            pinIsr++;
        }

        // turn off interrupts
        GPIOIRQ.IO0IntEnR = 0x00000000;
        GPIOIRQ.IO0IntEnF = 0x00000000;

        GPIOIRQ.IO2IntEnR = 0x00000000;
        GPIOIRQ.IO2IntEnF = 0x00000000;

        // flush pending interrupts
        GPIOIRQ.IO0IntClr = 0xFFFFFFFF;
        GPIOIRQ.IO2IntClr = 0xFFFFFFFF;
    }
    
    if(!CPU_INTC_DeactivateInterrupt( LPC24XX_VIC::c_IRQ_INDEX_EINT3 )) return FALSE;
    
    return TRUE;
}
BOOL LPC24XX_TIMER_Driver::Uninitialize( UINT32 Timer )
{
    ASSERT(Timer < c_MaxTimers);

    GLOBAL_LOCK(irq);

    if(g_LPC24XX_TIMER_Driver.m_configured[Timer] == FALSE) return FALSE;

    //--//

    if(!CPU_INTC_DeactivateInterrupt( LPC24XX_TIMER::getIntNo(Timer) )) return FALSE;

    LPC24XX_TIMER& TIMER = LPC24XX::TIMER( Timer );

    //Reset timer
    TIMER.TCR = 0x2;
    // disable Timer
    TIMER.TCR = 0;

    //--//

    g_LPC24XX_TIMER_Driver.m_configured[Timer] = FALSE;

    return TRUE;
}
// ---------------------------------------------------------------------------
BOOL HAL_Time_Uninitialize()
{
    SYSTIMER->MCR &= ~1; // Disable interrupt
    CPU_INTC_DeactivateInterrupt(SYSTIMER_IRQn);
    SYSTIMER->TCR = 0x0; // Disable timer
    return TRUE;
}
BOOL AT91_TIMER_Driver::Uninitialize( UINT32 timer )
{
    // Get Timer pointer
    AT91_TC &tc = AT91::TIMER(timer);

    CPU_INTC_DeactivateInterrupt( AT91C_ID_TC0 + timer );

    // Disable the clock
    tc.TC_CCR = AT91_TC::TC_CLKDIS;

    // Clear Irq Status
    (void) tc.TC_SR;

    // Disable All Irq
    tc.TC_IDR = 0xFFFFFFFF;

    // First, enable the clock of the TIMER
    AT91_PMC &pmc = AT91::PMC();
    pmc.PMC_PCDR = (1 << (AT91C_ID_TC0+timer));

    g_AT91_TIMER_Driver.m_descriptors[timer].configured = FALSE;
    g_AT91_TIMER_Driver.m_descriptors[timer].isr = NULL;
    g_AT91_TIMER_Driver.m_descriptors[timer].arg = NULL;

    return TRUE;
}
void EthernetDeepSleep()
{
    netif_set_down(&g_STM32F4_ETH_NetIF);
    STM32F4_ETH_LWIP_close(FALSE);
    LwipNetworkStatus = 0;
    eth_powerUpPhy(FALSE);

    DeInitContinuations();
    CPU_INTC_DeactivateInterrupt(ETH_IRQn);
}
BOOL LPC178X_I2C_Driver::Uninitialize()
{
#if 0
    LPC178X_I2C& I2C = LPC178X::I2C();

    CPU_INTC_DeactivateInterrupt(NVIC_TO_INTC(I2C0_IRQn));

    I2C_DeInit(I2C_0);
//    I2C.I2CONCLR = ( LPC178X_I2C::AA | LPC178X_I2C::SI | LPC178X_I2C::STO | LPC178X_I2C::STA | LPC178X_I2C::I2EN );
#endif
    return TRUE;
}
BOOL MC9328MXL_LCD_Driver::Uninitialize()
{
    NATIVE_PROFILE_HAL_PROCESSOR_LCD();
    HAL_Time_Sleep_MicroSeconds_InterruptEnabled( MC9328_LCD_TIME_POWER_STABLE );       // Wait for LCD charge pumps to shut down

    CPU_INTC_DeactivateInterrupt( MC9328MXL_AITC::c_IRQ_INDEX_LCDC_INT );

    // Turn off LCDC
    MC9328MXL::LCDC().RMCR = MC9328MXL_LCDC::RMCR__LCDC_EN__DISABLE << MC9328MXL_LCDC::RMCR__LCDC_EN_shift;

    return TRUE;
}
BOOL HAL_Time_Uninitialize()
{
    CPU_INTC_DeactivateInterrupt(TIM2_IRQn);
    
    TIM4->CR1 &= ~TIM_CR1_CEN; // disable timers
    TIM3->CR1 &= ~TIM_CR1_CEN;
    TIM2->CR1 &= ~TIM_CR1_CEN;
    
    // disable timer 2-4 clocks
    RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN | RCC_APB1ENR_TIM3EN | RCC_APB1ENR_TIM4EN);
    
    return TRUE;
}
Beispiel #11
0
// ---------------------------------------------------------------------------
BOOL CPU_GPIO_Uninitialize()
{
    for (int i = 0; i < TOTAL_GPIO_INT; i++)
    {
        g_completions[i].Abort();
    }

    for (int i = 0; i < TOTAL_GPIO_PORT; i++)
    {
        CPU_INTC_DeactivateInterrupt(PIN_INT0_IRQn + i);
    }
    
    return TRUE;
}
BOOL AT91_TSADCC_Driver::Uninitialize()
{
	struct AT91S_TSADC *pTSADC = (struct AT91S_TSADC *)AT91C_BASE_TSADCC;
	
	AT91_PMC &pmc = AT91::PMC();
    
	CPU_INTC_DeactivateInterrupt( AT91C_ID_TSADCC);
	
	pmc.EnablePeriphClock(AT91C_ID_TSADCC);    
	
	
	pTSADC->TSADC_MR = 0;
	
	//debug_printf("AT91_TSADCC_Driver::Uninitialize called\r\n");
	return TRUE;
}
HRESULT AT91_USBHS_Driver::Uninitialize( int Controller )
{
    GLOBAL_LOCK(irq);

    AT91_PMC_DisableUTMIBIAS();
    AT91_PMC_DisableUSBClock();

    ProtectPins( Controller, TRUE );

    CPU_INTC_DeactivateInterrupt( AT91C_ID_UDP);

    g_AT91_USBHS_Driver.pUsbControllerState = NULL;


    return S_OK;
}
BOOL HAL_Time_Uninitialize()
{
    CPU_INTC_DeactivateInterrupt(TIM_32_IRQn);
    
    TIM_16->CR1 &= ~TIM_CR1_CEN; // disable timers
    TIM_32->CR1 &= ~TIM_CR1_CEN;
    
    // disable timer clocks
#ifdef RCC_APB1ENR_TIM_16_EN
    RCC->APB1ENR &= ~(RCC_APB1ENR_TIM_32_EN | RCC_APB1ENR_TIM_16_EN);
#else
    RCC->APB1ENR &= ~RCC_APB1ENR_TIM_32_EN;
    RCC->APB2ENR &= ~RCC_APB2ENR_TIM_16_EN;
#endif
    
    return TRUE;
}
//Unitialize the specified channel
void	QED_Uninitialize	(int channel) {
	if (channel !=0) 
		return;	
	GLOBAL_LOCK(irq);
	//disable counter and interrupt
	QED_SetCountEnable(0, FALSE);
	CPU_INTC_DeactivateInterrupt(TIM2_IRQn);
	//release A and B pins
	CPU_GPIO_ReservePin(0, FALSE);
	CPU_GPIO_ReservePin(1, FALSE);
	for (int IOIndex = 0; IOIndex < 2; IOIndex++) {
		//release IO pins and discard capture/compare
		QED_ReleaseIO(0, IOIndex);
		g_completion[IOIndex].Uninitialize();
	}

}
HRESULT PXA271_USB_Driver::Uninitialize( int Controller )
{
    ASSERT( 0 == Controller );
    
    GLOBAL_LOCK(irq);

    ProtectPins( Controller, TRUE );

    g_PXA271_USB_Driver.pUsbControllerState = NULL;

    CPU_INTC_DeactivateInterrupt( PXA271_AITC::c_IRQ_INDEX_USB_CLIENT );

    // Deactivate the clock for power savings
    PXA271::CLKMNGR().CKEN &= ~PXA271_CLOCK_MANAGER::CKEN__USB_CLIENT_48MHZ;

    return S_OK;
}
BOOL LPC24XX_EMAC_Driver::Close( )
{
    int retVal = -1;

    CPU_INTC_DeactivateInterrupt(LPC24XX_VIC::c_IRQ_INDEX_EMAC);

    retVal = xn_interface_close(g_LPC24XX_EMAC_Driver.m_interfaceNumber);
    
    
    if (retVal == 0)
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}
BOOL STM32F4_ETH_LWIP_Driver::Close(void)
{
    CPU_INTC_DeactivateInterrupt(ETH_IRQn);

    DeInitContinuations();

    LwipNetworkStatus = 0;
    eth_powerUpPhy(FALSE);
    
    netif_set_down( &g_STM32F4_ETH_NetIF );
    netif_remove( &g_STM32F4_ETH_NetIF );

    STM32F4_ETH_LWIP_close(TRUE);
  
    memset( &g_STM32F4_ETH_NetIF, 0, sizeof g_STM32F4_ETH_NetIF );

    return TRUE;
}
Beispiel #19
0
// ---------------------------------------------------------------------------
void CPU_GPIO_DisablePin(GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction,
                         GPIO_ALT_MODE AltFunction)
{
    GPIO_IRQ_T *obj;
    PIN_Config(Pin, 0); // Reset to default

    for (int i = 0; i < TOTAL_GPIO_INT; i++)
    {
        *obj = gpio_irq[i];

        if (obj->pin == Pin)
        {
            CPU_INTC_DeactivateInterrupt(PIN_INT0_IRQn + obj->ch);
            obj->pin = GPIO_PIN_NONE;
            obj->isr = NULL;
            obj->param = NULL;
        }
    }
}
BOOL AT91_EMAC_LWIP_Driver::Close(void)
{
    LwipUpTimeCompletion.Abort();

    CPU_INTC_DeactivateInterrupt(AT91C_ID_EMAC);

    InterruptTaskContinuation.Abort();

    LwipNetworkStatus = 0;

    netif_set_down( &g_AT91_EMAC_NetIF );
    netif_remove( &g_AT91_EMAC_NetIF );

    AT91_EMAC_LWIP_close( &g_AT91_EMAC_NetIF );
    
    memset( &g_AT91_EMAC_NetIF, 0, sizeof g_AT91_EMAC_NetIF );

    return TRUE;
}
BOOL LPC24XX_EMAC_LWIP_Driver::Close( )
{
    LwipUpTimeCompletion.Abort();

    /* Disable the interrupt */
    CPU_INTC_DeactivateInterrupt(LPC24XX_VIC::c_IRQ_INDEX_EMAC);

    InterruptTaskContinuation.Abort();

    LwipNetworkStatus = 0;

    netif_set_down( &g_LPC24XX_EMAC_NetIF );
    netif_remove( &g_LPC24XX_EMAC_NetIF );

    LPC24XX_EMAC_lwip_close( &g_LPC24XX_EMAC_NetIF );
    
    memset( &g_LPC24XX_EMAC_NetIF, 0, sizeof g_LPC24XX_EMAC_NetIF);

    return TRUE;
}
BOOL SH7264_SMSC_LWIP_Driver::Close(void)
{
    LwipUpTimeCompletion.Abort();

    //CPU_INTC_DeactivateInterrupt(SH7264C_ID_EDMAC);
    CPU_INTC_DeactivateInterrupt(81);

    InterruptTaskContinuation.Abort();

    LwipNetworkStatus = 0;

    netif_set_down( &g_SH7264_SMSC_NetIF );
    netif_remove( &g_SH7264_SMSC_NetIF );

    SH7264_SMSC_lwip_close( &g_SH7264_SMSC_NetIF );
    
    memset( &g_SH7264_SMSC_NetIF, 0, sizeof g_SH7264_SMSC_NetIF);

    return TRUE;
}
BOOL AT91_EMAC_Driver::Close(void)
{
    int retVal = -1;

    CPU_INTC_DeactivateInterrupt(AT91C_ID_EMAC);

    /* JRT - changed interface number from 0 */
    retVal = xn_interface_close(g_AT91_EMAC_Driver.m_interfaceNumber);
    
    
    if (retVal == 0)
    {
        /* JRT - Wait not necessary since just did a HARD_CLOSE above
        xn_wait_pkts_output(RTP_TRUE, 60);
        */
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}
BOOL PXA271_USART_Driver::Uninitialize( int comPort )
{
    GLOBAL_LOCK(irq);
    
    PXA271::CLKMNGR().CKEN &= ~All_USART_ports[comPort].ClockIndex;         // Disable clock to USART

    PXA271_USART& USART = PXA271::USART( comPort );

    CPU_INTC_DeactivateInterrupt( USART_TX_IRQ_INDEX(comPort) );

    // uninit GPIO pins
    ProtectPins( comPort, TRUE );       // Also, disable clock to USART to reduce power consumption

    All_USART_ports[comPort].CTS_Pin_used = FALSE;
    All_USART_ports[comPort].RTS_Pin_used = FALSE;
    
    // uninit control registers
    USART.IER = 0;  // Disable USART
    USART.FCR = PXA271_USART::FCR__RESETRF | PXA271_USART::FCR__RESETTF;        // Reset FIFOs

    return TRUE;
}
BOOL PXA271_TIMER_Driver::Uninitialize( UINT32 Timer )
{
    ASSERT(Timer < c_MaxTimers);

    GLOBAL_LOCK(irq);

    DisableCompareInterrupt( Timer );

    if(g_PXA271_TIMER_Driver.m_descriptors[Timer].configured == FALSE) return FALSE;

    g_PXA271_TIMER_Driver.m_descriptors[Timer].configured = FALSE;

    //--//

    if( Timer < c_FirstPXA271_Timer )     // If one of the PXA250 compatible timers
    {
        // Interrupts for each timer are shut down individually
        UINT32 interrupt = 0;
        
        switch(Timer)
        {
        case 0:
            interrupt = PXA271_AITC::c_IRQ_INDEX_OS_TIMER0;
            break;
        case 1:
            interrupt = PXA271_AITC::c_IRQ_INDEX_OS_TIMER1;
            break;
        case 2:
            interrupt = PXA271_AITC::c_IRQ_INDEX_OS_TIMER2;
            break;
        case 3:
            interrupt = PXA271_AITC::c_IRQ_INDEX_OS_TIMER3;
            break;
        }

        if(!CPU_INTC_DeactivateInterrupt( interrupt )) return FALSE;
    }
    else
    {
        int i;

        // All PXA271 timers share a single interrupt
        for( i = c_FirstPXA271_Timer; i < c_MaxTimers && !g_PXA271_TIMER_Driver.m_descriptors[i].configured; i++ );     // Search for configured timers
        if( i == c_MaxTimers )       // If the last timer has been deactivated
        {
            if( !CPU_INTC_DeactivateInterrupt(PXA271_AITC::c_IRQ_INDEX_OS_TIMER) ) return FALSE;
        }
    }

    //--//

    // If the last timer is disabled, make sure the clock is shut off also to conserve power
    {
        int i;

        for( i = 0; i < c_MaxTimers && !g_PXA271_TIMER_Driver.m_descriptors[i].configured; i++);
        if( i == c_MaxTimers )      // If the last timer was uninitialized
        {
            PXA271_CLOCK_MANAGER &CLOCK = PXA271::CLKMNGR();

            CLOCK.CKEN &= ~PXA271_CLOCK_MANAGER::CKEN__OS_TIMER;     // Shut down the clock to the OS Timer
        }
    }

    return TRUE;
}
HRESULT PXA271_USB_Driver::Initialize( int Controller )
{
    int endpointsUsed = 0;
    const USB_ENDPOINT_DESCRIPTOR  *ep    = NULL;
    const USB_INTERFACE_DESCRIPTOR *itfc  = NULL;
    USB_CONTROLLER_STATE &State = UsbControllerState[0];

    ASSERT( Controller == 0 );

    GLOBAL_LOCK(irq);

    PXA271_USB& USB = PXA271::USB();

    // make sure clock is enabled
    PXA271::CLKMNGR().CKEN |= PXA271_CLOCK_MANAGER::CKEN__USB_CLIENT_48MHZ;

    // Enable the only interrupt
    CPU_INTC_ActivateInterrupt( PXA271_AITC::c_IRQ_INDEX_USB_CLIENT, Global_ISR, NULL );

    for( int i = 0; i < c_Used_Endpoints; i++ )
        EndpointInit[i].word = 0;       // All useable endpoints initialize to unused

    // For all endpoints in the USB configuration
    while( USB_NextEndpoint( &State, ep, itfc) )
    {
        UINT8 endpointNum   = ep->bEndpointAddress & 0x7F;
        UINT16 endpointSize = ep->wMaxPacketSize;
        
        // Check interface and endpoint numbers against hardware capability
        if( endpointNum >= c_Used_Endpoints || itfc->bInterfaceNumber > 7 )
            return S_FALSE;
        
        EndpointInit[endpointNum].bits.EN   = endpointNum;
        EndpointInit[endpointNum].bits.ED   = (ep->bEndpointAddress & 0x80) ? 1 : 0;
        EndpointInit[endpointNum].bits.IN   = itfc->bInterfaceNumber;
        EndpointInit[endpointNum].bits.ET   = ep->bmAttributes & 0x03;
        EndpointInit[endpointNum].bits.CN   = 1;        // Always only 1 configuration = 1
        EndpointInit[endpointNum].bits.AISN = 0;        // No alternate interfaces
        EndpointInit[endpointNum].bits.EE   = 1;        // Enable this endpoint

        // Set the maximum size of the endpoint hardware FIFO
        if( (ep->bmAttributes & 0x03) == USB_ENDPOINT_ATTRIBUTE_BULK )
        {
            // If the endpoint maximum size in the configuration list is bogus
            if( endpointSize != 8 && endpointSize != 16 && endpointSize != 32 && endpointSize != 64 )
                return S_FALSE;
            EndpointInit[endpointNum].bits.MPS = endpointSize;
            State.MaxPacketSize[endpointNum]   = endpointSize;
        }
        else if( (ep->bmAttributes & 0x03) == USB_ENDPOINT_ATTRIBUTE_INTERRUPT )
        {
            if( endpointSize == 0 || endpointSize > 64 )
                return S_FALSE;
            EndpointInit[endpointNum].bits.MPS = endpointSize;
            State.MaxPacketSize[endpointNum]   = endpointSize;
        }
        else        // Isochronous endpoint
        {
            if( endpointSize > 64 )
                endpointSize = 64;
            EndpointInit[endpointNum].bits.MPS = endpointSize;
            State.MaxPacketSize[endpointNum]   = endpointSize;
        }

        // Since endpoint 0 is only used for control, there is never a need to allocate a buffer for it
        // In fact State.Queues[0] is always NULL - it is a cheap placeholder to make the queueIndex = endpointIndex
        QueueBuffers[endpointNum-1].Initialize();                       // Clear queue before use
        State.Queues[endpointNum] = &QueueBuffers[endpointNum-1];       // Attach queue to endpoint

        // Set up direction information
        if( EndpointInit[endpointNum].bits.ED )         // If transmit endpoint
        {
            EndpointInit[endpointNum].bits.DE = 1;      // Only transmit is double buffered
            State.IsTxQueue[endpointNum]      = TRUE;
        }
        else        // If receive endpoint
        {
            EndpointInit[endpointNum].bits.DE = 0;
            State.IsTxQueue[endpointNum]      = FALSE;
        }
        endpointsUsed++;
    }
    
    // If no endpoints were initialized, something is seriously wrong with the configuration list
    if( 0 == endpointsUsed )
    {
        CPU_INTC_DeactivateInterrupt( PXA271_AITC::c_IRQ_INDEX_USB_CLIENT );
        return S_FALSE;
    }

    g_PXA271_USB_Driver.pUsbControllerState  = &State;
    g_PXA271_USB_Driver.PinsProtected        = TRUE;

    State.EndpointStatus = &g_PXA271_USB_Driver.EndpointStatus[0];
    State.EndpointCount  = c_Used_Endpoints;
    //State->DeviceStatus   = USB_STATUS_DEVICE_SELF_POWERED;
    State.PacketSize     = c_default_ctrl_packet_size;
    
    State.FirstGetDescriptor = TRUE;

    ProtectPins( Controller, FALSE );

    return S_OK;
}
Beispiel #27
0
BOOL LPC24XX_DAC_Driver::Off()
{
	if(g_LPC24XX_DAC_Driver.SampleTimeInCycles == 0) return FALSE;
	  
	ASSERT(LPC24XX_DAC::Timer < LPC24XX_TIMER_Driver::c_MaxTimers);

    GLOBAL_LOCK(irq);

    if(g_LPC24XX_TIMER_Driver.m_configured[LPC24XX_DAC::Timer] == FALSE) return FALSE;

    //--//
	
	//reset IRQ priority
	LPC24XX_VIC& VIC = LPC24XX::VIC();	
	VIC.VECTPRIORITY[LPC24XX_TIMER::getIntNo(LPC24XX_DAC::Timer)] = 0xF;
	
    if(!CPU_INTC_DeactivateInterrupt( LPC24XX_TIMER::getIntNo(LPC24XX_DAC::Timer) )) return FALSE;

    LPC24XX_TIMER& TIMER = LPC24XX::TIMER( LPC24XX_DAC::Timer );

    //Reset timer
    TIMER.TCR = 0x2;
	//Reset Match0 and Match Control regs
	TIMER.MR0 = 0x0;
	TIMER.MCR = 0x0;
    // disable Timer
    TIMER.TCR = 0;

    //--//

    
	g_LPC24XX_TIMER_Driver.m_configured[LPC24XX_DAC::Timer] = FALSE;

	#if defined(TIME_DAC_ISR)
	
	UINT16 maxSamplesUsed = 6400;
	long double avgInterTicks = 0.0;
	long double sigmaInterTicks = 0.0;
	double tickTimeMicroSecs = 1000000.0/CPU_TicksPerSecond();
	debug_printf("Tick length = %eus\r\n",tickTimeMicroSecs);
	for(int i = 0; i < maxSamplesUsed-1; i++)
	{
		/*if(i<100)
		{
			debug_printf("execStartTicks[%u]=%u\r\n",i+1,execStartTicks[i+1]);
			debug_printf("-\r\nexecStartTicks[%u]=%u\r\n",i,execStartTicks[i]);
			debug_printf("=\r\n%u\r\n\r\n",(execStartTicks[i+1] - execStartTicks[i]));
		}*/
		avgInterTicks += (execStartTicks[i+1]-execStartTicks[i]);
		//debug_printf("avgInterTicks = %e\r\n",avgInterTicks);
	}
	avgInterTicks=avgInterTicks/(maxSamplesUsed-1);
	debug_printf("Avg Time between ISR executions = %eus\r\n",avgInterTicks*tickTimeMicroSecs);
	
	for(int i = 0; i < maxSamplesUsed; i++)
	{
		sigmaInterTicks += pow((execStartTicks[i+1] - execStartTicks[i])-avgInterTicks,2);
	}
	sigmaInterTicks = sqrt(sigmaInterTicks/maxSamplesUsed);
	debug_printf("Std Deviation in Times = %eus\r\n",sigmaInterTicks*tickTimeMicroSecs);
	
	#endif
	
	#if defined(MONITOR_BUFFER_LEVEL)
	for(bufLevelMarkCount = 0; bufLevelMarkCount<80; bufLevelMarkCount++)
		debug_printf("%u\r\n",bufferLevel[bufLevelMarkCount]);
	bufLevelMarkCount = 0;
	#endif
    return TRUE;
}