⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smfm.c

📁 这个是单片机4200的ui程序
💻 C
📖 第 1 页 / 共 3 页
字号:
    return;

}
/**********************************************************************\
 *	Test Mode : Operational Panel
 *
 * Note
 * History
 *	2003.01.09	Aceking Wang		Create
\**********************************************************************/
void  SM_KeyBoard(void)
{
    UINT16  currentbutton = 0;
    UINT8   step = 0, loop = 1;
    char    buf[34];

	while (loop){
        //currentbutton = UIGetKey();

        /* Process Button Request */
			if (TM_OPPanelProc(step++) == TEST_OPPANEL_PROC_END)
				loop = 0;
			break;

        /* Be a good OS citizen */
        TASKSLEEP_MILLISECONDS(50);
    }
	
    return;
}

#if 0
static void DRAM_OPButton(void)
{
	UINT16  currentbutton = 0;
	UINT8   loop = 1;

	while (loop){
        currentbutton = UIGetKey();

        /* Process Button Request */
        switch (currentbutton)
        {
	        case PANEL_SELECT:
			case PANEL_BACK:
				loop = 0;
				break;
        }

        /* Be a good OS citizen */
        TASKSLEEP_MILLISECONDS(50);
    }
}


void SM_DRAM(void)
{
	char	str1[17];
    char	buf[34];
  //  UINT32	i;

//	Application_Task_Delete();
	
//	DRAM_RW_OK = FALSE;
//	tempMemory = FreeMemory;
//	FreeMemoryBlock = FreeMemorySize/(1024*100);

	sprintf(str1, "D-RAM:");
//	if (DRAM_RWStatusGet())
//		sprintf(buf, "%-16s\n%16s", str1, " complete    ok ");
//	else
//		sprintf(buf, "%-16s\n%16s", str1, " complete  error");
	LCDStringOut(0, 0, buf, strlen(buf));
/*
	while(FreeMemoryBlock)
	{
		memset(tempMemory, 0x3c, 1024*100);
		tempMemory += 1024*50;
		FreeMemoryBlock--;
	}
	
	memset(tempMemory, 0x3c, FreeMemorySize%(1024*100));

	tempMemory = FreeMemory;
	FreeMemoryBlock = FreeMemorySize;
	while (FreeMemoryBlock)
	{
		if (*tempMemory != 0x3c)
			break;
		FreeMemoryBlock--;
	}
	if (FreeMemoryBlock == 0)
		DRAM_RW_OK = TRUE;

	Application_Task_Init();
	
*/
	DRAM_OPButton();	
}
#endif

void SM_FAXSpeaker(void)
{
	Uint8   loop = 1;
    	Uint16  currentbutton = 0;    
//	char    buf[34];

	LCDDisplayClear();
	strcpy(firstlinebuf,GetMsgData(DISP_TEST_RESULT));
	strcpy(secondlinebuf,GetMsgData(Ms_OKNG[ut]));

	DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
	DisplayLCD(1, secondlinebuf, MIDDLE, TRUE);
	ut = 0;
	SpeakerSoundPlay(SOUND_OF_RING);	
	while (loop)
	{
    		
        currentbutton = UIGetKey();
		
	switch (currentbutton)
		{
		case PANEL_SELECT:
			loop=0;
			if(ut == 0)
				gDiagnosticResult.Speaker_TestResult=1;
			else
				gDiagnosticResult.Speaker_TestResult=0;
			break;
		case PANEL_ARROWLEFT:
		case PANEL_ARROWRIGHT:
			if(ut == 0)
				ut = 1;
			else
				ut = 0;
			break;
		case PANEL_NONE:
			continue;
		default:				
			break;	
	        }
	LCDDisplayClear();
	strcpy(firstlinebuf,GetMsgData(DISP_TEST_RESULT));
	strcpy(secondlinebuf,GetMsgData(Ms_OKNG[ut]));

	DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
	DisplayLCD(1, secondlinebuf, MIDDLE, TRUE);

	TASKSLEEP_MILLISECONDS(50);
    }
	SoundPlayOff();
	
}

void SM_FAXFunction(void)
{
//	char	str1[17];
    char	buf[34];
	UINT8   loop = 1;
	UINT16  currentbutton = 0;
	Bool	boolTrs = FALSE, boolRcv = FALSE;

	strcpy(firstlinebuf,GetMsgData(DISP_TEST));
	sprintf(secondlinebuf,"%s?",GetMsgData(DISP_FAXBOARD));

	LCDDisplayClear();
	DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
	DisplayLCD(1, secondlinebuf, MIDDLE, FALSE);

	while (loop)
	{
		currentbutton = UIGetKey();

        /* Process Button Request */
        switch (currentbutton)
        {
        case PANEL_SELECT:
			strcpy(firstlinebuf,GetMsgData(DISP_FAXBOARD));
			sprintf(secondlinebuf,"%s....",GetMsgData(DISP_TESTING));
			
			LCDDisplayClear();
			DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
			DisplayLCD(1, secondlinebuf, MIDDLE, FALSE);
			if (FAX_Diagnose())
				{
					strcpy(firstlinebuf,GetMsgData(DISP_FAX_TEST_RESULT));
					strcpy(secondlinebuf,GetMsgData(DISP_MYTECS_REPFAX_OK));
				
					LCDDisplayClear();
					DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
					DisplayLCD(1, secondlinebuf, MIDDLE, FALSE);
					gDiagnosticResult.FAX_TestResult=1;
				}
			else
				{
					strcpy(firstlinebuf,GetMsgData(DISP_FAX_TEST_RESULT));
					strcpy(secondlinebuf,GetMsgData(DISP_NG));
					
					LCDDisplayClear();
					DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
					DisplayLCD(1, secondlinebuf, MIDDLE, FALSE);
					gDiagnosticResult.FAX_TestResult=0;

				}
			
			break;
		case PANEL_BACK:
			loop = 0;
			break;
		default:
			break;
        }

		TASKSLEEP_MILLISECONDS(50);
	}


}

#if 0
void SM_ADFSensor(void)
{
    char	str1[17];
    char	buf[34];
	UINT8   loop = 1;
	UINT16  currentbutton = 0;    
	Bool	boolDS = FALSE, boolDES = FALSE;

	while (loop)
	{
		currentbutton = UIGetKey();

        /* Process Button Request */
        switch (currentbutton)
        {
        case PANEL_SELECT:
			// DS Sensor
			if (boolDS)
			{
				sprintf(str1, "%s", "DS: on");
			}
			else
			{
				sprintf(str1, "%s", "DS: off");
			}
			// DES Sensor
			if (boolDES) 	
			{
				sprintf(buf, "%-16s\n%-16s", str1, "DES: on");
			}
			else
			{
				sprintf(buf, "%-16s\n%-16s", str1, "DES: off");
			}
			LCDStringOut(0, 0, buf, strlen(buf));
			break;
		case PANEL_BACK:
			loop = 0;
			break;
		default:
			break;
        }

		TASKSLEEP_MILLISECONDS(50);
	}

	return;
}


/**********************************************************************\
 *	Test Mode : PRIMAX ADF TEST ITEM
 *
 * Note
 * History
 *	2005.05.20	Peter Lin	Create
\**********************************************************************/
void   SM_ADFFeeding(void)
{
#if 0
    UINT16  currentbutton = 0;
    UINT8   loop = 1;
    Bool	b, testStart;
    UINT16  adfTestCount, adfCopyCount, oldadfTestCount = 0;
    char    buf[42];

	sprintf(buf, "%-16s\n%16s", "ADF Feeding", "");
	LCDStringOut(0, 0, buf, strlen(buf));
	
    adfTestCount = 0;
    adfCopyCount = 0;
    b = FALSE;
    testStart = FALSE;
	
    ADF_TestModeInit();
	while (loop)
    {
        if (testStart)
        {
            UINT8   sts;

            sts = ADF_TestMode();
            GetADFPaperCount(&adfTestCount, NULL);
            if (sts > 0)
            {
                testStart = FALSE;
                adfCopyCount += adfTestCount;
                adfTestCount = 0;
            }

            if (adfTestCount > oldadfTestCount)
            {
                oldadfTestCount = adfTestCount;
                b = TRUE;
            }
        }

        if (b)
        {
            LCDDisplayClear();
            sprintf(buf, "%-20s\n        P.%04d/%04d", "8-1: ADF FEEDING", adfTestCount, adfCopyCount + adfTestCount);
            LCDStringOut(0, 0, buf, strlen(buf));
            b = FALSE;
        }

        currentbutton = UIButtonDetect();


        /* Process Button Request */
        switch (currentbutton)
        {
        case PANEL_BLACK_COPY:
        case PANEL_COLOR_COPY:
            testStart = TRUE;
            oldadfTestCount = 0;
            break;
        case PANEL_STOP:
            if (testStart == TRUE)
                testStart = FALSE;
            else
                loop = FALSE;
            break;
        }

   } 
#endif	
	return;
}
#endif

#if 0
/******************************************************************************
*  ADF_TestMode  
*  This routine is for ADF testmode function 
*  Create: 2005/5/5 
*  Author: Peter Lin 
* 
******************************************************************************/
UINT8 ADF_TestMode(void)
{  
  	switch(scanG.state) 
	{
	case SCAN_IDLE:
		printf("ADF TEST");
		if(ADF_CheckDS())
		{
			printf( "ADF TEST START");
			scanG.state           = ADF_TEST;
			scanG.testSubState    = 0;
			//SCAN_MOTOR_TABLE_SIZE = 7;
			//scanG.stepType        = HALF_STEP;
			//ADFMotorCurrent       = MidiumCurrent;
			ADF_Test_Page=0;
			//SCHS_MotorOff();
			return 0;
		}
		break;    
	case ADF_TEST:
        switch (scanG.testSubState)
		{
        case 0:			
			if (scanMotorCmd.command == COMPLETED)
    		{
	    		ADFMotorEnable();
				//ADF_GoDES();
			    ADF_ScanTest();
				scanG.testSubState++;
                //scanG.testSubState = 2;
			    //printf( "ADF TEST GOTO DES");
			}
			return 0;
        case 1:
			if (scanMotorCmd.command == COMPLETED)
    		{
	    		
				ADF_Test_Page++;
			    ADFMotorEnable();
				ADF_LeaveDES();
                scanG.testSubState++;
			    //printf( "ADF TEST LEAVE DES");
    		}
			return 0;
		case 2:
            if (scanMotorCmd.command == COMPLETED)
            {
			    //if another paper on the ADF,test again
				if(ADF_CheckDS())         
				{
					scanG.state=ADF_TEST;
					scanG.testSubState = 0;
				}
				else
				{
					ADFMotorEnable();
					ADF_Feed_PaperOut();
					scanG.testSubState++;
					//ADF_feedout_step      = ADFFeedOutDistance;
					//printf( "ADF TEST FEEDOUT");
				}
		    }		
			return 0;
		case 3:
            if (scanMotorCmd.command == COMPLETED)
            {
				scanG.state = SCAN_IDLE;
				scanG.testSubState = 0;
				//SCHS_MotorOff();
	            Remove_PrimaxADF_FeedMotor_Power();
				RemovePowerL6219Ref1();
				printf(" pages=%d",ADF_Test_Page);
				printf( "ADF test finiah");
			//	return 1;
			}
		}
		break;
	default:
		break;
	}
	return 1;
}
#endif

void SM_ScannerMotor(void)
{
    	char	buf[34],firstlinebuf[17],secondlinebuf[17];
	Uint8   loop = 1,step=0,loop1=1;
	Uint16  currentbutton = 0;    
	Uint32	Heating_times=0,i=0;
	
	//LCDDisplayClear();
	//DisplayLCD(0, "FlatBed  Scan", MIDDLE, FALSE);
	//DisplayLCD(1, "Heating Run?", MIDDLE, FALSE);
	strcpy(firstlinebuf,GetMsgData(DISP_INPUT));
	strcpy(secondlinebuf,GetMsgData(DISP_RUNTIMES));

	LCDDisplayClear();
	DisplayLCD(0, firstlinebuf, MIDDLE, FALSE);
	DisplayLCD(1, secondlinebuf, MIDDLE, FALSE);
	ut = 0;
while(loop1)
{	 TASKSLEEP_MILLISECONDS(50);
	currentbutton = UIGetKey();

				switch(currentbutton)
				{
				
				case	PANEL_NUM0:
						Heating_times=Heating_times*10;
						step++;
						break;
				case	PANEL_NUM1:
						Heating_times=Heating_times*10+1;
						step++;
						break;
				case	PANEL_NUM2:
						Heating_times=Heating_times*10+2;
						step++;
						break;
				case	PANEL_NUM3:
						Heating_times=Heating_times*10+3;
						step++;
						break;

				case	PANEL_NUM4:
						Heating_times=Heating_times*10+4;
						step++;
						break;
				case	PANEL_NUM5:
						Heating_times=Heating_times*10+5;
						step++;
						break;
				case	PANEL_NUM6:
						Heating_times=Heating_times*10+6;
						step++;
						break;
				case	PANEL_NUM7:
						Heating_times=Heating_times*10+7;
						step++;
						break;
				case	PANEL_NUM8:
						Heating_times=Heating_times*10+8;
						step++;
						break;
				case	PANEL_NUM9:
						Heating_times=Heating_times*10+9;
						step++;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -