예제 #1
0
void main (void)
{
	Init_Device();
	SPI0CFG |= 0x07;	//8 Bits pro Master-SPI-Transfer
	EA=1;
	LCD_init = 1;  // Bit zur Verzweigung in der ISR
	P5=0x0F;
	CONTROL_LCD = SMB_BUS_ERROR;

	LCD_write();

	P2_0 = 1;

	while(1)
	{
//		switch(P5)
//		{
//			case 0x07:
//			{
			
					SPI_read();
					show_display(1,ken5);
//					break;
//			}
//
//			default:
//			{
//					break;
//			}
//		}
	}
}
int main(int argc, char *argv[])
{
	struct display *d;
	int xd = 79;
	int yd = 23;

	d = create_display(xd + 1, yd + 1);

	draw_rectangle(d, 0, 0, xd, yd);
	draw_line(d, 0, 0, xd, yd); 
	draw_line(d, 0, yd, xd, 0); 
	draw_circle(d, xd / 2, yd / 2, yd / 3);
	show_display(d);

	free_display(d);
	return 0;
}
예제 #3
0
void Init_video(char* argv[])
{
   
	TOMREGS->vmode = RGB16|CSYNC|BGEN|PWIDTH4|VIDEN;  // Setup the type of diplay we wish to work with.

	init_interrupts(); // Initialize the basic interupts.
	init_display_driver(); // Initalize the display driver.
	  
	display *d = new_display(0); // Create a pointer for the display so we can reference it later.
	d-> x = 0; // set the x position of the display (in relation to the top-left corner).
	d-> y = 0; // set the y position of the display (in relation to the top-left corner).
	
	show_display(d);  //Turn on the display, so we can actually see it on the screen.
	
	// Sadly, the default resolution is not 320x240 but something like 352x256
	// There must be way to set it to 320X240, JagDoom is using 256x240 after all
}
예제 #4
0
void main(){

	WDTCTL = WDTPW | WDTHOLD;

	ConfigPuertos();

	PRST |= RST;
	delay(200);
	PRST &= ~RST;						/*Reset lcd controller*/
	delay(200);
	PRST |= RST;
	delay(2000);
	vopcode=0x28;						/*Electronic volumn setting*/
	Ra_Rb=0x27;							/*Internal resistance ratio*/
	lcd_init();							/*Initialize the LCD controller*/


	show_display((char *) logo);		/*Show 128x128 pictures*/

	for(;;){
		//show_display((char *) logo);	/*Show 128x128 pictures*/
		//wait(1000);
	}
}
예제 #5
0
파일: main.c 프로젝트: azhuravkin/localtraf
int main(int argc, char **argv) {
    int iostream;
    int opt;

    if (getuid()) {
	fprintf(stderr, "This program can be run only by root.\n");
	exit(EXIT_FAILURE);
    }

    setlocale(LC_ALL, "");

    struct option longopts[] = {
	{"help",       0, 0, 'h'},
	{"interface",  1, 0, 'i'},
	{"no-resolve", 0, 0, 'n'},
	{"port",       1, 0, 'p'},
	{NULL,         0, 0, '\0'}
    };

    /* Parse command line options. */
    while ((opt = getopt_long(argc, argv, "hi:np:", longopts, NULL)) != EOF) {
	switch (opt) {
	    case 'i':
		snprintf(opts.interface, sizeof(opts.interface), "%s", optarg);
		break;
	    case 'n':
		opts.resolve = FALSE;
		break;
	    case 'p':
		opts.port = atoi(optarg);
		break;
	    default:
		usage(argv[0]);
		break;
	}
    }

    /* Save filter expression */
    if (optind < argc) {
	for (strcat(opts.expression, "and "); optind < argc; optind++) {
	    strncat(opts.expression, argv[optind], sizeof(opts.expression));
	    strncat(opts.expression, " ", sizeof(opts.expression));
	}
    }

    if (opts.port) {
	/* Goto background. */
	if (fork())
	    exit(EXIT_SUCCESS);

	close(STDIN_FILENO);
	close(STDOUT_FILENO);
	close(STDERR_FILENO);

	iostream = open(_PATH_DEVNULL, O_RDWR);
	dup(iostream);
	dup(iostream);

	start_daemon();
    } else
	show_display();

    return 0;
}