Ejemplo n.º 1
0
Archivo: main.c Proyecto: cpantel/ciaa
void StartupHook(void) {
   boardConfig();   
   setupUart();
   ReadTec1Init();
   BlinkLed3Init();
   ShowElapsedTimeInit();
} 
Ejemplo n.º 2
0
int main(void)
{
    DDRA = 0xFF;
    DDRC = 0xFF;
    DDRG = 0xFF;
    PORTA = 0x00;
    PORTC = 0x01; // disable display
    PORTG = 0x00;

    setupUart();
    sei();

    for (uint8_t i = 0; i < 3; i++) {
	PORTG = 0x00;
	_delay_ms(500);
	PORTG = 0xFF;
	_delay_ms(500);
    }

    uint8_t row = 0;
    while (1) {

	#if DISPLAY_HEIGHT == 32
	muxRows(row, displayBuffer[row], displayBuffer[row+16], DISPLAY_WIDTH_BYTES);
	#else
	muxRow(row, displayBuffer[row], DISPLAY_WIDTH_BYTES);
	#endif

	row++;
	if (row >= 16) {
	    row = 0;
	}
    }
}
Ejemplo n.º 3
0
int main(int argc, char *argv[])
{
	char* filename;
	s32 ret;
	mipsCpu* cpu;
	
	printf("greenLeaf 0.1\n");
	printf("mips emulator by The Lemon Man and SquidMan\n");

	if(argc < 2) {	/* No arguments passed. */
		filename = calloc(5, 1);
		sprintf(filename, "test/mmon");
	}else{
		filename = calloc(strlen(argv[1]) + 1, 1);
		sprintf(filename, argv[1]);
	}

#ifdef DEBUG
	printf("Debug mode enabled\n");
#endif
	printf("Initializing the CPU core...\n");
	cpu = initializeCPU(ENDIANNESS_LE, 0x80000000);
	
	printf("Mapping the ram...\n");
	
	printf("Main memory %d\n",	mapMemory(cpu, 0x80000000, 0x40000, FLAG_RAM));
	printf("Reset vector %d\n",	mapMemory(cpu, 0xBFC00000, 0x40000, FLAG_RAM));
	printf("Additional mem %d\n",	mapMemory(cpu, 0xA0000010, 0x2000, FLAG_RAM));
	
//	ret = openRaw(cpu, filename, 0xBFC00000);
	ret = openElf32(cpu, filename);

	printf("Entry %#x\n",	(u32)ret);
	
	printf("Uart %i\n",	setupUart(cpu, 0xB40003f8));
	
	setPC(cpu, ret);
	
	printf("Press enter to run a tick and print the registers...\n");
	printf("Press enter to continue.\n");
	for(;;) {
#ifdef TICK_AT_A_TIME
		fgetc(stdin);
#endif
		runProcessor(cpu, 1);		/* Run a single cycle at a time */
		//~ printRegisters(cpu);
	}
	
	printf("Execution finished... unmapping the ram\n");
	
	unmapMemory(cpu);
	
	free(filename);
	
	return 1;
}
Ejemplo n.º 4
0
int main(void)
{
    setupLed();
    setupUart();
    vmInit();
    
    install((Object*) &uart, (Method) uartReceiveInterrupt, IRQ_USART0_RX);
    install((Object*) &uart, (Method) uartSentInterrupt, IRQ_USART0_TX);
    
	TINYTIMBER(NULL, NULL, 1);
}