//***************************************************************************** // // Walking Robot // //***************************************************************************** int main(void) { // // Set the clocking to run directly from the crystal. // //Caution! All current settings depend from 6MHz frqequency of clocking!!! SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ); /*=============================SysTick===================================*/ SysTickPeriodSet( SysCtlClockGet() / WR_SYS_TIMER_FREQUENCY ); IntPrioritySet( FAULT_SYSTICK, 0 ); SysTickIntEnable(); SysTickEnable(); /*=======================================================================*/ /*=============================USER CODE=================================*/ WRPWMInit(); WRTimerInit(); WRFlashInit(); WRServInit(); WRLegInit(); WRUART0Init(); WRUART1Init(); WRConsoleInit(); SonarInit(); /*=======================================================================*/ /*===============================OLED====================================*/ // // Initialize the OLED display and write status. // // Display96x16x1Init(false); /*=======================================================================*/ while(1) { if (GetStatus()==3) WRSendDistance(GetDistFromSonar()); //=================blink========================== //================================================ } }
int main() { init(); printf("System On and Finish Init\r\n"); LEDOn(LED1); LEDOn(LED2); _file_system_init(); printf("Init done\r\n"); SonarInit(); RFIDSendCommand(kRFIDOn); RFIDSetCallback(_cbRFID); RFIDSetCallback(_cbSonar); /*LEDDecoderSet(1);*/ /*while (1) {*/ /*printf("Dis = %d\r\n", SonarRead());*/ /*sleep(100);*/ /*}*/ /*int res = GUI_GIF_Draw((const void*) bmpfile, rd, 50, 50);*/ /* Tasks */ xTaskCreate(heartbeat, "heartbeat", 200, NULL, 1, NULL); xTaskCreate(readUART1, "UART1", 300, NULL, 1, NULL); xTaskCreate(readUART3, "UART3", 300, NULL, 1, NULL); /*xTaskCreate(SonarScanTask, "sonar", 200, NULL, 1, NULL);*/ xTaskCreate(GUITask, "gui_main", 1000, NULL, 1, NULL); xTaskCreate(touchScreenUpdate, "touch", 200, NULL, 1, NULL); vTaskStartScheduler(); }