예제 #1
0
파일: cpux9k2.c 프로젝트: Aorjoa/bootloader
int do_brightness(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int rcode = 0;
	ulong side;
	ulong bright;

	switch (argc) {
	case 3:
		side = simple_strtoul(argv[1], NULL, 10);
		bright = simple_strtoul(argv[2], NULL, 10);
		if ((side >= 0) && (side <= 3) &&
				(bright >= 0) && (bright <= 1000)) {
			vcxk_setbrightness(side, bright);
			rcode = 0;
		} else {
			printf("parameters out of range\n");
			printf("Usage:\n%s\n", cmdtp->usage);
			rcode = 1;
		}
		break;
	default:
		printf("Usage:\n%s\n", cmdtp->usage);
		rcode = 1;
		break;
	}
	return rcode;
}
예제 #2
0
int init_vcxk(void)
{
	VIDEO_Invert_CFG &= ~VIDEO_Invert_IO;
	VIDEO_INVERT_PORT |= VIDEO_INVERT_PIN;
	VIDEO_INVERT_DDR  |= VIDEO_INVERT_PIN;

	VIDEO_REQUEST_PORT |= VIDEO_REQUEST_PIN;
	VIDEO_REQUEST_DDR |= VIDEO_REQUEST_PIN;

	VIDEO_ACKNOWLEDGE_DDR &= ~VIDEO_ACKNOWLEDGE_PIN;

	vcxk_driver = search_vcxk_driver();
	if (vcxk_driver)
	{
		/* use flash resist driver */
	}
	else
	{
		vcxk_cls();
		vcxk_cls();
		vcxk_setbrightness(1000);
	}
	VIDEO_ENABLE_DDR |= VIDEO_ENABLE_PIN;
	VIDEO_ENABLE_PORT |= VIDEO_ENABLE_PIN;
	VIDEO_ENABLE_PORT &= ~VIDEO_ENABLE_PIN;
	return 1;
}