Ejemplo n.º 1
0
static void bootstrap()
{
	const int moduleClock = 12000000;
	const int KHzInHz = 1000;
	const int baud = 115200;
	mcgInit();
	sdramInit();
	svcInit_SetSVCPriority(15);
	setSysTickPriority(14);
	setPendSVPriority(14);
	uartInit(UART2_BASE_PTR, moduleClock/KHzInHz, baud);
	lcdcInit();
	lcdcConsoleInit(&console);
	adc_init();
	vfs_init();
	ledInitAll();
	pushbuttonInitAll();
	TSI_Init();
	TSI_Calibrate();
	init_memory();
	//uinit();
	intSerialIOInit();
	flexTimerInit();
	sysTickInit();
}
Ejemplo n.º 2
0
int main(void) {
	/* Initialize all of the LEDs */
		ledInitAll();
		/* Initialize both of the pushbuttons */
		pushbuttonInitAll();
	rotate();
	return 0;
}
Ejemplo n.º 3
0
int main(void) {
    int number_presses = 0;

    /* Initialize all of the LEDs */
    ledInitAll();
    /* Initialize both of the pushbuttons */
    pushbuttonInitAll();

    /* initially orange LED should be on and all others should be off */
    ledOrangeOn();

    while(1) {
        if (sw1In()) {
            /* avoid contact bounce */
            delay(DELAY_LIMIT);

            number_presses++;
            if (number_presses == 4) {
                number_presses = 0;
            }

            if (number_presses == 0) {
                ledOrangeOn();
            } else {
                ledOrangeOff();
            }

            if (number_presses == 1) {
                ledYellowOn();
            } else {
                ledYellowOff();
            }

            if (number_presses == 2) {
                ledGreenOn();
            } else {
                ledGreenOff();
            }

            if (number_presses == 3) {
                ledBlueOn();
            } else {
                ledBlueOff();
            }

            /* wait until button released before checking if pushed again */
            while(sw1In()) { ; }
        }
    }

    return 0;
}
Ejemplo n.º 4
0
static void bootstrap()
{
	const int moduleClock = 60000000;
	const int KHzInHz = 1000;
	const int baud = 115200;
	mcgInit();
	sdramInit();
	svcInit_SetSVCPriority(7);
	uartInit(UART2_BASE_PTR, moduleClock/KHzInHz, baud);
	lcdcInit();
	lcdcConsoleInit(&console);
	adc_init();
	vfs_init();
	ledInitAll();
	pushbuttonInitAll();
	TSI_Init();
	TSI_Calibrate();
	init_memory();
	uinit();
	privUnprivileged();
}
Ejemplo n.º 5
0
void initialize_io_button(void) {
    pushbuttonInitAll();
}