void init() { srand(0); /* Obviously not a very good seed but useful for testing... */ memset(&counts, 0, sizeof(counts)); time_init(); led_init(); menu_init(); button_init(); enable_leds(); sei(); }
/* * initialize * ----------------------------------------------- * initialize the lpc2148 pll * cpu interrupts * the uart0 serial port * the rtc VIC interrupt */ void initialize(void) { // PLL and MAM // hwSysInit(SIXTY_MHZ); // hwSysInit(FOURTYEIGHT_MHZ); // hwSysInit(THIRTYSIX_MHZ); hwSysInit(TWENTYFOUR_MHZ); // hwSysInit(TWELVE_MHZ); // enable interrupts in the CPSR enableIRQ(); // enable the leds enable_leds(); // 48Mhz PCLK, divisor is 0x1a for 115200 console0Init(ONE_FIFTEEN_TWO_B); // enable the interrupt control register. enableTIMER0_INT(0x4, (unsigned) TIMER0_Handler ); }