/** Initialize data structures. * This is called before the X connection is opened. */ void Initialize(void) { InitializeBackgrounds(); InitializeBorders(); InitializeClients(); InitializeClock(); InitializeColors(); InitializeCommands(); InitializeCursors(); InitializeDesktops(); #ifndef DISABLE_CONFIRM InitializeDialogs(); #endif InitializeDock(); InitializeFonts(); InitializeGroups(); InitializeHints(); InitializeIcons(); InitializeKeys(); InitializePager(); InitializePlacement(); InitializePopup(); InitializeRootMenu(); InitializeScreens(); InitializeSettings(); InitializeSwallow(); InitializeTaskBar(); InitializeTray(); InitializeTrayButtons(); }
U8 InitializeMicroAPI(void) { InitializePorts(); InitializeClock(); InitializeSPI(); InitializeUART1(k115200); InitializeInterrupts(); GpioSet(NSSpin); InitializeTimers(); RealTimeClockOn(); StartIntervalTimer(); return 0; }
int main(void) { WDTCTL = WDTPW | WDTHOLD; // Must stop WDT InitializeClock(); InitializeLeds(); InitializeButton(); speed = 12000; eint(); // same as _BIS_SR(GIE); while(1) { delay(60000); LED_OUT |= LED2; delay(3000); LED_OUT &= ~LED2; } return 0; }
//-----------------------Private functions-----------------------------// int main(void) { uint16_t i; for( i = 0; i < 64000; i++) asm("nop"); InitializeClock(); InitializeSysTick(); #ifdef _USE_DISPLAY InitializeDisplay(); #endif #ifdef _USE_MOTORS InitializeMotors(); #endif #ifdef _USE_ADC_BATTERY InitializeBattery(); #endif #ifdef _USE_ADC_SHARP InitializeSharp(); #endif #ifdef _USE_ENCODERS InitializeEncoders(); #endif #ifdef _USE_SERVOS InitializeServos(); #endif #ifdef _USE_LED_NUCLEO InitializeLedNucleo(); #endif #ifdef _USE_LED_14 InitializeLed14(); #endif #ifdef _USE_LED_EYE InitializeLedEye(); #endif #ifdef _USE_BT InitializeBT(); #endif #ifdef _USE_WIFI InitializeWifi(); #endif #ifdef _USE_MPU InitializeMPU(); #endif #if 0 if(//MPU error)) { //sth bad had happened... } #endif oMotors.SetSpeedLeft( 0.0f ); oMotors.SetSpeedRight( 0.0f ); oServos.SetAngleArmLeft( 0.0f ); oServos.SetAngleArmRight( 0.0f ); oServos.SetAngleCamVer( 0.0f ); oServos.SetAngleCamHor( -15.0f ); while (1) { } return 0; }