Exemple #1
0
/*
 * NAME
 *
 *  main
 *
 * DESCRIPTION
 *
 *  prints out a standard banner on serial port
 *
 *   "University of Washington - UART Test Application"
 *
 * PARAMETERS
 *
 *  none...
 *
 * EXAMPLE
 *
 * from crt.s
 *
 *  B  main
 *
 * NOTES
 *
 *  This routine never terminates...
 *
 */
int main(void)
{
	uint32_t p;
	
    /* initialize */
    initHardware();
    
    printString("\033[2J"); /* Clear entire screen */
    printString("Olimex LPC-2378-STK... alive!!!\n");
    
    //sprintf(string, "sprintf works!\n");
    //printString(string);

    while (1)
    {
        /* Turn MCIPWR SD LED On */
        VOLATILE32(FIO0SET) |= 1<<21;
        
        printString("University of Washington - UART Test Application \n");
        for (p = 0; p < 0x100000; p++ );        // wait

        // IMPORTANT: String formatting drags in tons of other library code
        //  sprintf(string, "\n.%u", p);
        //  printString(string);
        
        /* Turn MCIPWR SD LED Off */
        VOLATILE32(FIO0CLR) |= 1<<21;
        for (p = 0; p < 0x100000; p++ );        // wait
    }
    /* never terminates, but put this here to make compiler happy ... */
    return(0);
}
Exemple #2
0
void classic_led_on()
{
   VOLATILE32(FIO0SET) |= 1<<21;
}
Exemple #3
0
void classic_led_off()
{
   VOLATILE32(FIO0CLR) |= 1<<21;
}