Esempio n. 1
0
//------------------------------------------------------------------------------
BOOL CNetscapeStatusBar::ResetPanes( EStatBarMode enStatBarMode, BOOL bForce /*=FALSE*/ )
{
    if( !bForce && (m_enStatBarMode == enStatBarMode) )
    {
        return TRUE;
    }

    if( m_enStatBarMode != enStatBarMode )
    {
        // Save state info of the current pane mode
        SaveModeState();
    }
    
    //
    // Set new panes/indicators
    //
    m_enStatBarMode = enStatBarMode;
    
    if( enStatBarMode != eSBM_Simple )
    {
        // The previous mode shall never be eSBM_Simple (eSBM_Simple is for menu help text)

        pParentSubclass->SetPrevMode( enStatBarMode );
    }
    
    SetupMode();
    
    return TRUE;
}
Esempio n. 2
0
/********************************************************************
Function name:       MpuDSecDemo
Input parameters:
    NULL
Return:
    NULL
Function:
    MPU SRAM  Secmode  function.
********************************************************************/
void MpuDSecDemo(void)
{
	UINT32 desaddr,srcaddr,back;
	UINT16 i;
	UINT8 *p;
	UINT32 *addr1;
	desaddr = 0x2000F800;
	srcaddr = (UINT32)dma_src;

	MpuSetSecMode(MPUCR_SEC1_EN);
	addr1 = (UINT32 *)0x2000F800;
	back = *addr1;
	*addr1 = 0x12345678;
	if(*addr1 != 0x12345678)
	{
		//Todo: program fail;
		printf("MpuDSecDemo err \r\n");
	}
	else
	{
		*addr1 = back;
		printf("MpuDSecDemo OK\r\n");
	}

	Memset(dma_src, 0xFF, sizeof(dma_src));

	ScuDmaClkEn();
	DmaChLock(0);
	SetupMode(0, MEM_MEM, DISCRIC, 0, 0, 1, 1, W_8BIT, 10, 0);

	SetTransAddress(0, srcaddr, desaddr);
	SetTransLength(0, 10);


	if(DmaTrans(0) != DMA_RET_SUCESS)
	{
		//TODO:program fail; 
	}
	else
	{
		p = (UINT8*)0x2000F800;
		for(i = 0;i<10;i++,p++)
		{
			if(dma_src[i]!= *p)
			{
				//TODO: program fail
				printf("MpuDSecDemo DMA err \r\n");
				return;
			}				 
		}
	}
	printf("MpuDSecDemo DMA OK \r\n");
	DmaChUnlock(0);
	ScuDmaClkDis();
	MpuClrSecMode(MPUCR_SEC1_EN);
}
Esempio n. 3
0
void DmaIntModeDemo(void)
{
    UINT8 ch_no;    //Dma channel number
    UINT32 len = 1023;
    UINT32 tmp_src[1023], tmp_dst[1023];
    UINT8 ret;

    printf("Dma Int Mode Demo.\r\n");
    /* enable Dma Clk */
    ScuDmaClkEn();
    for(ch_no = 0; ch_no < 8; ch_no++)
    {
        trans_finish_flag = FALSE;
        /* initial source data */
        GetTrueRand8((UINT8 *)tmp_src, len << 2);
        /* lock dma channel */
        ret = DmaChLock(ch_no);
        /* setting dma trans interrupt handle */
        ret |= DmaSetIntrHandle(ch_no, DmaFinishHdl, NULL, NULL, NULL);
        /* setting dma trans parameter */
        ret |= SetupMode(ch_no, MEM_MEM, DISCRIC, NO_PER, NO_PER, ENINC, ENINC, W_32BIT, len, H_PRI);
        /* setting dma trans address */
        ret |= SetTransAddress(ch_no, (UINT32)tmp_src, (UINT32)tmp_dst);
        /* start dma trans */
        ret |= DmaStart(ch_no);
        if(ret != DMA_RET_SUCESS)
        {
            printf("dma channel %d trans error, error code %d\r\n", ch_no, ret);
            return;
        }

        /* wait trans finish */
        while(trans_finish_flag == FALSE);
        /* disable dma channel trrans finish interrupt */
        DisDmaIntr(0x1 << ch_no);
        if(Memcmp(tmp_src, tmp_dst, len) != 0)
        {
            printf("dma channel %d trans error, data error\r\n", ch_no);
            return;
        }
        else
        {
            printf("dma channel %d trans sucess\r\n", ch_no);
        }
        DmaChUnlock(ch_no);
    }
    ScuDmaClkDis();
}
Esempio n. 4
0
void DmaScanModeDemo(void)
{
    UINT8 ch_no;    //Dma channel number
    UINT32 len = 1023;
    UINT32 tmp_src[1023], tmp_dst[1023];
    UINT8 ret;

    printf("Dma Scan Mode Demo.\r\n");
    /* enable Dma Clk */
    ScuDmaClkEn();
    for(ch_no = 0; ch_no < 8; ch_no++)
    {
        /* initial source data */
        GetTrueRand8((UINT8 *)tmp_src, len << 2);
        /* lock dma channel */
        ret = DmaChLock(ch_no);
        /* setting dma trans parameter */
        ret |= SetupMode(ch_no, MEM_MEM, DISCRIC, NO_PER, NO_PER, ENINC, ENINC, W_32BIT, len, H_PRI);
        /* setting dma trans address */
        ret |= SetTransAddress(ch_no, (UINT32)tmp_src, (UINT32)tmp_dst);
        /* start dma trans */
        ret |= DmaTrans(ch_no);
        if(ret != DMA_RET_SUCESS)
        {
            printf("dma channel %d trans error, error code %d\r\n", ch_no, ret);
            return;
        }

        /* dma trans finish */
        if(Memcmp(tmp_src, tmp_dst, len) != 0)
        {
            printf("dma channel %d trans error, data error\r\n", ch_no);
            return;
        }
        else
        {
            printf("dma channel %d trans sucess\r\n", ch_no);
        }
        DmaChUnlock(ch_no);
    }
    ScuDmaClkDis();
}
Esempio n. 5
0
//------------------------------------------------------------------------------
BOOL CNetscapeStatusBar::SetIndicators(const UINT* lpIDArray, int nIDCount)
{
	BOOL res = CNetscapeStatusBarBase::SetIndicators(lpIDArray, nIDCount);
	if (res) {
		m_iSavedCount = nIDCount;
		delete [] m_anIDSaved;
		if (m_iSavedCount) {
			m_anIDSaved = new UINT[m_iSavedCount];
			for (int i = 0; i < m_iSavedCount; i++) {
				m_anIDSaved[i] = lpIDArray[i];
			}
		} else {
			m_anIDSaved = NULL;
		}
		SetupMode();
#ifdef MOZ_TASKBAR
		((CNetscapeApp *)AfxGetApp())->GetTaskBarMgr().OnSizeStatusBar( this );
#endif /* MOZ_TASKBAR */
		SaveModeState();
	}
	return res;
}