Exemplo n.º 1
0
void loop(void) 
{	
    test_uart(hal.uartA, "uartA");
    test_uart(hal.uartB, "uartB");
    test_uart(hal.uartC, "uartC");
    test_uart(hal.uartD, "uartD");
    test_uart(hal.uartE, "uartE");

    // also do a raw printf() on some platforms, which prints to the
    // debug console
#if HAL_OS_POSIX_IO
    ::printf("Hello on debug console at %.3f seconds\n", hal.scheduler->millis()*0.001f);
#endif

    hal.scheduler->delay(1000);
}
Exemplo n.º 2
0
void loop()
{
    // 1 Hz loop
    if((hal.scheduler->micros() - timer) > 1000000UL) {
        timer = hal.scheduler->micros();
        hal.console->println("Looping @ 1 Hz ...");
        test_uart(hal.uartA, "uartA");
    }
}
Exemplo n.º 3
0
static void * case_thread(DirectThread *thread, void *arg)
{
	int ret;
	case_t *caseP = arg;
	bool passflg = false;
	FILE *fp = NULL;
	char command[100];
	struct stat st;
	bool iio_enable;
	
	iio_enable = is_iio_enable();
	printf("iio_enable = %d\n", iio_enable);

	if(caseP->type == 0)
	{
		switch(caseP->index)
		{
			//mem
			case mem:
				sprintf(command, "memtester %s 1 2 > /memerr.log 1> /dev/null", caseP->nod_path);
				// printf("command = %s\n", command);
				ret = system(command);
				// printf("mem ret = %d\n", ret);
				if(!ret && stat("/memerr.log", &st) >= 0) //获取文件信息
				{
					if(st.st_size == 0)
					{
						passflg = true;
					}
				}
				break;
			case ddrsize:
				passflg = test_ddrsize(caseP);
				break;	
			//flash	
			case flash:;
				passflg = test_flash(caseP);
				break;
			//wifi
			case wifi:
				passflg = test_wifi(caseP);
				break;
			case bt:
				passflg = test_bt(caseP);
				break;
			//gsensor	
			case gsensor:
				if(!iio_enable)
					passflg = test_gsensor(caseP);
				else
					passflg = test_iio(caseP, info);
				break;
			case gyro:
				if(!iio_enable)
					passflg = false;
				else
					passflg = test_iio(caseP, info + 1);
				break;
			case comp:
				if(!iio_enable)
					passflg = false;
				else
					passflg = test_iio(caseP, info + 2);
				break;
			case lightsensor:
				passflg = test_lightsensor(caseP);
				break;
			//camera	
			// case camera:
				// passflg = wait_dev_plugin(caseP->nod_path);
				// break;
			//rtc
			case rtc:
				passflg = test_rtc(caseP);
				break;
			case gps:
				passflg = test_gps(caseP);
				break;
			case uart:
				passflg = test_uart(caseP);
				break;
			case ethernet:
				passflg = test_ethernet(caseP);
				break;
		}
	}
	else if(caseP->type == 1)
	{
		switch(caseP->index)
		{
			//sdcard
			case 0:
				passflg = test_mmc(caseP);
				break;
			//usb
			case 1:
				passflg = test_usb(caseP);
				break;
			case 2:
				passflg = test_pc(caseP);
				break;
			//hdmi
			case 3:
				wait_nod_state(caseP, &hdmi_flg);
				//test_hdmi(caseP, &hdmi_flg);
				break;
			//headphone
			case 4:
				wait_nod_state(caseP, &headphone_flg);
				break;
			//key
			case 5:
				passflg = test_key(caseP);
				break;
			//onoff
			case 6:
				passflg = test_key_onff(caseP);
				break;
			//charege
			case 7:
				passflg = test_charge(caseP);
				break;
			//mtv
			case 8:
				passflg = test_mtv(caseP);
				break;
		}
	}
	
	draw_result(caseP, passflg);
}