示例#1
0
int main(void)
{
	
	ConfigPins();
	initUART();
	initSysTick();	
	RValue = initAccel();	
	printInteger(RValue);
	if (RValue == 0) {
		printString("Boldly going :)\r\n");
	} else {
		printString("Inertia sensors offline :(\r\n");
	}
	while (1) { 		
		Temperature = getTemperature();		
		printShort(Temperature);		
		printString(" ");					
		getMotion(&m);
		printShort(m.x_a);		
		printString(" ");
		printShort(m.y_a);		
		printString(" ");
		printShort(m.z_a);		
		printString(" ");		
		printString("\r\n");				
		GPIO0DATA ^= BIT2;				
		delay(10000);
	}

	return 0;
}
示例#2
0
int main(void)
{
	LedData ledData;
	ButtonData buttonData;

	initUserButton();
	CLK_EN();
	configureLED(LED3, PORTG);
	configureLED(LED4, PORTG);
	configureLED(LED5, PORTB);
	configureLED(LED6, PORTC);
	buttonInitData(&buttonData);
	ledInitData(&ledData);

	initSysTick();
  
	initTcb();
	//testFunc();
	taskSwitch();

    while(1)
    {
    	//updateTime();
    	//buttonSM(&buttonData);
    	//ledSM(&ledData);
    }
}
示例#3
0
/* Main Initfunction --------------------------------------------------------*/
void initSystem()
{
    /* Configure the system clocks */
    RCC_Configuration();
    /* Configure TIMs */
    TIM_Configuration();
    /* Configure the GPIO ports UART */
    GPIO_Configuration();
    /* UART Interrupt */
    NVIC_Configuration();
    initUART1();
    initUART2();
    initUART3();
    //initUART4();
    /* initDMA for Sensors */
    initDMA();
    /* initADC for Sensros */
    initADC();
    /* inti System Ticker */
    /* does not work in Interrupt */
    /* Pause(ms) function */
    initSysTick();
    /* init I2C1 for Compas */
    initI2C();
}
示例#4
0
void main(void)
{
	initSysClock();

	initUartDebug();

	initLeds();

	initLaunchpadSW1();

	initSysTick();

	initBluetooth();

	initUSB();

	initRfModule(false);

	setRfTxAddress(RF_DESTINATION_ADDR);

	Network_setSelfAddress(RF_CONTOLBOARD_ADDR);

	while (true)
	{
		if ((g_bConnected == false) || (g_bSuspended == true))
		{
			GPIOPinWrite(LED_PORT_BASE, LED_ALL, LED_RED);
			continue;
		}

		GPIOPinWrite(LED_PORT_BASE, LED_ALL, LED_GREEN);

		if (g_USBRxState == USB_RX_DATA_AVAILABLE)
		{
			GPIOPinWrite(LED_PORT_BASE, LED_ALL, LED_BLUE);

			switch (usbBufferHostToDevice[0])
			{
			//-----------------Bootloader Handle-------------------

			case BOOTLOADER_BROADCAST_PACKET:
				broadcastBslData();
				break;

			case BOOTLOADER_SCAN_JAMMING:
				scanJammingSignal();
				break;

			default:
				normalPacketHandle();
				break;
			}

			g_USBRxState = USB_RX_IDLE;

			turnOffLED(LED_BLUE);
		}
	}
}
示例#5
0
void chip_init(int systick_hz)
{
	/** Interrupts are now disabled... */
	chip_interrupts_disable();

	/** initialize system */
	initSysTick();
	initializeWWDG();
}
int main( void )
{
    halInit();
    moduleInit();
    buttonIsr = &handleButtonPress;
    sysTickIsr = &sysTick;    
    printf("\r\n****************************************************\r\n");
    printf("Config Application Example - COORDINATOR\r\n");    
    clearLeds();    
    halRgbLedPwmInit();
    initSysTick();
    HAL_ENABLE_INTERRUPTS(); //NEW
    stateMachine();    //run the state machine
}
示例#7
0
int main(void)
{
	DisableInterrupts(); // Permet de ne pas avoir d'interruption durant l'initialisation
	LCD_Init();
	initGPIO();	//Appel des fonctions d'initialisation 
	initSysTick();
	initUART();
	initADC0();	
	EnableInterrupts(); // Active les interruptions pour la suite de l'exécution du programme

	__asm
	{
		WFI
	}

	while(1){} // Boucle vide
}
示例#8
0
文件: main.c 项目: shyanfeng/RTOS
int main(void){
	initSysTick();
	initTcb();
	//taskSwitch();
	//testFunc();

	TaskBlock tb_LED1;
	TaskBlock tb_LED2;
	TaskBlock tb_LED5;
	initLED();
	initLED2();
	initLED5();
	initPushButton1();
	initTaskBlock(&tb_LED1);
	initTaskBlock(&tb_LED2);
	initTaskBlock(&tb_LED5);

  while(1){
	SD1(&tb_LED1);
    SD2(&tb_LED2);
    SD5(&tb_LED5);
  }
}