// Delay function based on the system clock // Inputs: delay in millisecs void delayMS(unsigned long ms){ unsigned long i; Init_SysTick(); for(i=0; i<ms; i++){ Wait_SysTick(33003); // wait 1ms } }
//----------------------- // Main Routine //----------------------- int main(void) { // // Initialization // Init_SysTick(); Init_Color_LED(); //===�@BaudRate Setup === // UARTInit(38400); UARTInit(115200); // UARTInit(230400); // UARTInit(460800); // UARTInit(500000); // UARTInit(1000000); // 1Mbps //=== GPIO 0_6 0_8 0_9 R1_0 Function Setup . LPC_IOCON->R_PIO1_0 = 0x00000091; // digital , pullup ,GPIO :See LPC111x Users Manual. LPC_IOCON->PIO0_6 = 0x00000010; // GPIO, pullup LPC_IOCON->PIO0_8 = 0x00000010; // GPIO, pullup LPC_IOCON->PIO0_9 = 0x00000010; // GPIO, pullup // // Main Loop // while(1) { // // Draw Color LED // // Draw_Color_LED(); Set_Color_LED(7); // // Get Command // loop(); // UART_printf(">"); // get_line(Line, sizeof(Line)); } return 0; }
void timer_setup(){ Init_SysTick(0.00001); }