コード例 #1
0
ファイル: main.c プロジェクト: ADeadCat/mcuoneclipse
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
  CYG_Init();

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  DEMO_Init();

  (void)DEMO_Run();
  CYG_PrintCallTrace();
  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #2
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
	/* Write your local variable definition here */
	size_t heapSize=1;

	/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
	PE_low_level_init();
	/*** End of Processor Expert internal initialization.                    ***/

	/* Write your code here */
	(void)FRTOS1_xTaskCreate(Task1, (signed portCHAR *)"Task1", configMINIMAL_STACK_SIZE*3, NULL, tskIDLE_PRIORITY-1, NULL);
	(void)FRTOS1_xTaskCreate(Task1, (signed portCHAR *)"Task1", configMINIMAL_STACK_SIZE*3, NULL, tskIDLE_PRIORITY-2, NULL);
	heapSize = xPortGetFreeHeapSize();
	printf("starting my ADC application %d\n",heapSize);
	FRTOS1_vTaskStartScheduler();

	/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #3
0
ファイル: main.c プロジェクト: Raev0/Stepper_Acc_Driver
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
      PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

 setup();
  plan_buffer_line(2,1);
  //
  for(;;){ST_PULSE_TI_Enable();}


  //heat_manager();
  //inactivity_manager();




  /* Write your code here */
  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #4
0
ファイル: main.c プロジェクト: Btar/HEXIWEAR
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */

  /**
   * disable write buffering end enable exceptions,
   * for debugging purposes
   */

  SCB->SHCSR    |= 0x00070000;
  SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk;

  HEXIWEAR_Init();

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #5
0
int main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  
  ///* UART Bluetooth Rx on PTA1 */
  //PORT_PDD_SetPinPullSelect(PORTA_BASE_PTR, 1, PORT_PDD_PULL_UP);
  //PORT_PDD_SetPinPullEnable(PORTA_BASE_PTR, 1, PORT_PDD_PULL_ENABLE);

  SHELL_Run();

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
  return 0;
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #6
0
ファイル: ProcessorExpert.c プロジェクト: MpicoSys/USB2TCM
/**
 * Main USB2TCM function
 */
int main(void)
{

	/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
	PE_low_level_init();	
	TCM_disable();
	EM_Init();
	MS_InitDevices();
	
	possibleFile = 0;
	while (1)
	{
		if (possibleFile == 1)
		{
			
			readAndSendEPD();
			USBTCM_error=0;	
			LED_SetVal(NULL);
		}
	}

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
}
コード例 #7
0
int main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  
  /* UART Bluetooth Rx on PTC3 and Tx on PTC4 */
  /* pull-up RX/PTC3 for BT_BOARD V1.06 needed, see http://mcuoneclipse.com/2014/03/30/getting-bluetooth-working-with-jy-mcu-bt_board-v1-06/ */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 3, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 3, PORT_PDD_PULL_ENABLE);

  SHELL_Run();

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
  return 0;
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #8
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  i = 5;
  //k = i/j;
  for(;;) {
	  LED1_Neg();
	  WAIT1_Waitms(200);
	  LED2_Neg();
	  WAIT1_Waitms(200);
	  LED3_Neg();
	  WAIT1_Waitms(200);
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #9
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  /* Write your code here */
  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){
	  
	  (void)AD1_Measure(TRUE); /* do conversion and wait for the result */
	  (void)AD1_GetValue16(&value); /* get the result into value variable */
	  UTIL1_Num16uToStr(buf, sizeof(buf), value); /* transform into string */
	  i=0;
	  while(buf[i]!=0) {
	  RxBuf_Put(buf[i]); /* write string */
	  i++;
	  }
	  APP_Run();
  }
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #10
0
ファイル: main.c プロジェクト: alsancho/mcuoneclipse
void main(void)
{
  /* Write your local variable definition here */
  int i = 0;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */
  for(;;) {
	  i++;
	  if ((i%5)==0) {
		  data[0]++; /* change data */
		  TestFlash();
	  }
	  LED1_Neg();
	  WAIT1_Waitms(250);
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #11
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
	int counter = 0;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  bit1Ptr = Bit1_Init((LDD_TUserData *)NULL);        /* Initialize the pin */
	printf("Hello\r\n");
	
	while(1)
	{
	  if(counter >= 1000000)
	  {
		  Bit1_NegVal(bit1Ptr);
		  counter = 0;
	  }
	  counter++;
	}
  /* Write your code here */
  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #12
0
ファイル: main.c プロジェクト: waynenb/mcuoneclipse
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  printf("Welcome to the world of lwip!\r\n");

  /* Disable the mpu */
  MPU_BWR_CESR_VLD(MPU, 0);

  /* create lwIP initialization task */
  xTaskCreate(LwipInitTask,
      "LwipInitTask",
      configMINIMAL_STACK_SIZE * 4,
      (void*)NULL,
      tskIDLE_PRIORITY,
      (xTaskHandle*)NULL);

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #13
0
ファイル: main.c プロジェクト: funkyguy4000/ARM-Programs
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */
  LCD1_Clear();
  WAIT1_Waitms(1000);
  LCD1_WriteLineStr(1, "Hello FRDM-KL25z");
  for(;;) {
    uint8_t cnt;
    uint8_t buf[5];
 
    LCD1_GotoXY(2,1);
    UTIL1_Num16uToStr(buf, sizeof(buf), cnt);
    LCD1_WriteString((char*)buf);
    cnt++;
    WAIT1_Waitms(100);
  }
  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #14
0
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  f();
  /* For example: for(;;) { } */
  if (FRTOS1_xTaskCreate(MyTask, (signed portCHAR *)"Task",
		  configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL) != pdPASS) {
    for(;;){} /* error */
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #15
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  if (FRTOS1_xTaskCreate(
        LedTask,  /* pointer to the task */
        (signed char *)"Led", /* task name for kernel awareness debugging */
        configMINIMAL_STACK_SIZE, /* task stack size */
        (void*)NULL, /* optional task startup argument */
        tskIDLE_PRIORITY+1,  /* initial priority */
        (xTaskHandle*)NULL /* optional task handle to create */
      ) != pdPASS) {
    /*lint -e527 */
    for(;;){} /* error! probably out of memory */
    /*lint +e527 */
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #16
0
ファイル: main.c プロジェクト: c-kel/Assorted
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)


/*lint -restore Enable MISRA rule (6.3) checking. */
{
   /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  
  /* Write your code here */
  /* For example: for(;;) { } */
  _lwsem_create(&adcsem, 1);
  _lwsem_create(&i2csem, 1);
  _lwsem_create(&uartsem, 1);
  byte aslp_cnt	[2]=  {0x29, 0x5e};
  byte ctrl_reg1[2]= {0x2a, 0x01};//fast mode, active
  //CI2C1_SelectSlave(0x1d); //select mma8451q with sa=1
  Accel_SendBlock(ctrl_reg1, 2, &snt); //sleep& data rate 12.5hz, fast read on, active mode
  Accel_SendStop();
  Accel_SendBlock(aslp_cnt, 2, &snt); //30sec sleep time
  Accel_SendStop();
  //Term1_SetColor(clGreen, clBlack);

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} 
コード例 #17
0
ファイル: main.c プロジェクト: unbalancedgiraffe/SENS
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  MMA8451_Freedom_Init_50Hz(I2CFreedom_DeviceData, &thisAccel);
  /* Write your code here */
  //MMA8451_Freedom_Init_50Hz(I2CFreedom_DeviceData, &thisAccel);
  /* For example: for(;;) { } */
  for(;;){
	  if(UART_Flg){
	  		 UART_Flg = FALSE;
	  		 UART_SendBlock(UART_DeviceData,(byte *)'1', 1);
	  MMA8451_Freedom_ReadData(I2CFreedom_DeviceData, &thisAccel);
	  	// scale the HAL-aligned accelerometer measurements
	  	thisAccel.fGp[X] = (float) thisAccel.iGp[X] * thisAccel.fgPerCount;
	  	thisAccel.fGp[Y] = (float) thisAccel.iGp[Y] * thisAccel.fgPerCount;
	  	thisAccel.fGp[Z] = (float) thisAccel.iGp[Z] * thisAccel.fgPerCount;
	  }
  }
  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #18
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
	int DataUart0;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */

  debug_printf("FRDM-K64F System Init!\r\n");							// Envia mensaje de inicio
  debug_printf("Wayt for Data over UART0 <-> OpenSDA debug port\r\n");	// Imprime mensaje informativo

  for(;;){
	  DataUart0=debug_getchar();				// Espera dato por UART
	  debug_printf("%%c:%c\r\n",DataUart0);		// Imprime dato recibido en formato char
	  debug_printf("%%u:%u\r\n",DataUart0);		// Imprime dato recibido en formato entero
	  debug_printf("%%x:0x%x\r\n",DataUart0);	// Imprime dato recibido en formato hexadecimal
	  debug_printf("%%d:%d\r\n",DataUart0);		// Imprime dato recibido en formato decimal
	  debug_printf("\r\n");						// Imprime salto de linea
  }


  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #19
0
ファイル: ProcessorExpert.c プロジェクト: Joteyo/mcuoneclipse
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  LED2_On();
  WAIT1_Waitms(1000);
  LED2_Off();
  
#if PL_HAS_LOW_POWER
  LP_Init();
#endif
#if PL_HAS_RTOS
  if (FRTOS1_xTaskCreate(BlinkTask, "Blink", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL) != pdPASS) {
    for(;;){} /* error */
  }
#endif
#if PL_HAS_SHELL
  SHELL_Init();
#endif
#if PL_HAS_RTOS
  PEX_RTOS_START();
#endif
  for(;;) {
    LP_EnterPowerMode(LP_WAIT);
    LED1_On();
    WAIT1_Waitms(20);
    LED1_Off();
  }

  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #20
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
	/* Write your local variable definition here */

	/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
 	PE_low_level_init();
	/*** End of Processor Expert internal initialization.                    ***/

	/* Write your code here */
	/* For example: for(;;) { } */

	Boot_Check();
	AD1_Calibrate(TRUE);
	OLED_Init();
	unsigned char buffer[64*4];
	ClearScr(buffer,0);
	OLED_Display(buffer);
	DecoderInit();
	int T = 0;
	for(;;) {
		T++;
		ClearScr(buffer,0);
		for (int x = 0;x<64;x++)
		{
			buffer[Reader.Sync * 64 + x] = 255;
		}

		if (Reader.Sync == AUDIOREADER_SYNCED)
		{
			for (int i =0;i<theprogress/8;i++)
			{
				buffer[i] = 0xff;
			}

		}
		//else
		{
			for(int i =0 ;i<64;i++)
			{
				int y =  16 + (((History[i]-32768) * 15)/400);
				if (y>= 0 && y< 32) SetPixel(buffer, i, y);
			}
		}
		OLED_Display(buffer);

	}
	/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #21
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

#if OPTIMIZE_BIT_ACCESS
  GREEN_Clr(); /* turn on green LED */
  WAIT1_Waitms(1000);
  GREEN_Set(); /* turn off green LED */
  for(;;) {
    if (SW1_Get()==0) { /* button low level => pressed */
      RED_Clr(); /* LED cathode is connected to microcontroller pin: low level turns it on */
      BLUE_Set(); /* turn off blue led */
    } else {
      RED_Set(); /* turn off red led */
      BLUE_Clr(); /* turn on blue led */
    }
    if (SW2_Get()==0) { /* switch low level => pressed */
      BLUE_Clr(); /* turn on blue led */
    } else {
      BLUE_Set(); /* turn off blue led */
    }
  }
#else
  GREEN_ClrVal(GREEN_DeviceData); /* turn on green LED */
  WAIT1_Waitms(1000);
  GREEN_SetVal(GREEN_DeviceData); /* turn off green LED */
  for(;;) {
    if (SW1_GetVal(SW1_DeviceData)==0) { /* button low level => pressed */
      RED_ClrVal(RED_DeviceData); /* LED cathode is connected to microcontroller pin: low level turns it on */
      BLUE_SetVal(BLUE_DeviceData); /* turn off blue led */
    } else {
      RED_SetVal(RED_DeviceData); /* turn off red led */
      BLUE_ClrVal(BLUE_DeviceData); /* turn on blue led */
    }
    if (SW2_GetVal(SW2_DeviceData)==0) { /* switch low level => pressed */
      BLUE_ClrVal(BLUE_DeviceData); /* turn on blue led */
    } else {
      BLUE_SetVal(BLUE_DeviceData); /* turn off blue led */
    }
  }
#endif
  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #22
0
ファイル: main.c プロジェクト: ger-unicamp/TFC-2014
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
	{
  /* Write your local variable definition here */
	uint16 countServo;
	int i;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
	PE_low_level_init();
	ADC0_CFG2 |= ADC_CFG2_MUXSEL_MASK;
  /*** End of Processor Expert internal initialization.                    ***/
	
	
  /* Write your code here */
  /* For example: for(;;) { } */
	
	
	
/*
   * Motores são setados com valores de 0 a 255, 2o argumento resolve o sentido.
   */
	cameraSIBit_ClrVal();
	sMachine_Init();
	Serial_Init();
	enableMotor();
	setMotor(0,1,0);
	setMotor(1,1,0);
	servoPWM_Enable(servoPWM_DeviceData);
	countServo = 19000;
	servoPWM_SetDutyUS(servoPWM_DeviceData,countServo);
	cameraCLK_Enable();
	cameraCLK_EnableEvent();
	cameraCLKBit_ClrVal();
	while(1){
			for (i=0; i < 128; i++){
				vetorCamera[i] = getCamPixel(i);
			}
			for (i=0; i < 128; i++){
				itoa(vetorCamera[i], buffer0);
				Send_String(buffer0);
				Send_String(" ");
				}
			Send_String("\r\n");
  }
  
  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #23
0
ファイル: ProcessorExpert.c プロジェクト: zhangsaisai/SEMG
int main(void)
{
  /* Write your local variable definition here */
  uint32 i = 0;

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  
 //printf ("\n\n");  
 //printf("********************************************************\n");
 //printf("*                                                       \n");
 //printf("* Running SPI Demo, Master & Slave exchanged messages   \n");
 //printf("* Before continuing connect SPI0(Master)         \n");
 //printf("* to SPI1 (Slave) as outlined below              \n"); 
 //printf("*                                                \n"); 
 //printf("* MOSI:  PTA17 (J2 pin 11) to PTE1 (J2 pin 20)   \n");
 //printf("* MISO:  PTA16 (J2 pin  9) to PTE3 (J9 pin 11)   \n");
 //printf("* SCK:   PTC5  (J1 pin  9) to PTE2 (J9 pin  9)   \n");
 //printf("* PCS0:  PTC4  (J1 pin  7) to PTE4 (J9 pin 13)   \n");
 //printf("*                                                \n");
 //printf("* Then enter any key to continue                 \n");
 //printf("*                                                \n");
 //printf("********************************************************\n");
 //printf ("\n\n");
  
  /* Slave receiving some message from master*/
  SS1_ReceiveBlock(SS1_DeviceData, slave_receive, COMM_SIZE); 

  for(;;){   
        
  for(i=0;i<10000;i++){
	  //printf("\nSlave: first sending\n");
  } //Delay
   }
   

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
  return 0;
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #24
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

#if PL_HAS_SD_CARD
  /* SD card detection: PTE6 with pull-down! */
  PORT_PDD_SetPinPullSelect(PORTE_BASE_PTR, 6, PORT_PDD_PULL_DOWN);
  PORT_PDD_SetPinPullEnable(PORTE_BASE_PTR, 6, PORT_PDD_PULL_ENABLE);
#endif
#if PL_HAS_KEYS
  /* SW3: PTA4 */
  PORT_PDD_SetPinPullSelect(PORTA_BASE_PTR, 4, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTA_BASE_PTR, 4, PORT_PDD_PULL_ENABLE);
  /* SW2: PTC6 */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 6, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 6, PORT_PDD_PULL_ENABLE);
#endif
#if PL_HAS_BLUETOOTH
  /* pull up Rx pin (PTC14) for Bluetooth module */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 14, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 14, PORT_PDD_PULL_ENABLE);
#endif
  LED1_On();
  WAIT1_Waitms(50);
  LED1_Off();
  WAIT1_Waitms(50);
  LED2_On();
  WAIT1_Waitms(50);
  LED2_Off();
  WAIT1_Waitms(50);
  LED3_On();
  WAIT1_Waitms(50);
  LED3_Off();
  WAIT1_Waitms(50);
  APP_Start();

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #25
0
ファイル: main.c プロジェクト: AlexOlsen/CC2511-Labs
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */


  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */
  byte c, err;
  for (;;) {
	  do {
		  err = UART_RecvChar(&c);
	  } while(err != ERR_OK);
	  sendString("Press R, G or B to toggle the red, green or blue LEDs.\r\nPress ESC to close.\r\n");
	  do {
		  do {
			  err = UART_RecvChar(&c);
		  } while(err != ERR_OK);
		  if (c == 0x52 || c == 0x72) {
			  Red_NegVal();
			  sendString("Toggle red.\r\n");
		  } else if (c == 0x47 || c == 0x67) {
			  Green_NegVal();
			  sendString("Toggle green.\r\n");
		  } else if (c == 0x42 || c == 0x62) {
			  Blue_NegVal();
			  sendString("Toggle blue.\r\n");
		  }
	  } while(c != 0x1B);
	  sendString("Press any key to start.\r\n");
	  Red_SetVal();
	  Green_SetVal();
	  Blue_SetVal();
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #26
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
enum logics{false, true};
uint16_t rotation = 0;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  lcd_init(Background);

  add2display((unsigned char *)"University of Nairobi",0);
  add2display((unsigned char *)" Physics Department  ",0);
  add2display((unsigned char *)" another string for  ",0);
  add2display((unsigned char *)" another string menu ",0);
  selected=0;
  while(1){
	  if(rotation>3)
		  rotation = 0;
	  if(selected>3)
		  selected=0;
	  lcd_setOrientation(rotation);
	  lcd_clear(Background);
	  display();
	  //lcd_invert(rotation);
	  lcd_fillrect(10,50,40,60, blue);
	  lcd_drawrect(10,50,40,60, red);
	  lcd_drawline(11,51,39,59, green);
	  lcd_drawcircle(30, 100,10, red);
	  lcd_fillcircle(30, 100,10, crimson);
	  WAIT1_Waitms(1000);
	  selected++;
	  rotation++;
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #27
0
ファイル: main.c プロジェクト: ADeadCat/mcuoneclipse
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
  float temperature, humidity;
  uint8_t res;
  unsigned char buf[32];

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  CLS1_SendStr("\r\n-----------------------\r\nSHT11 Example\r\n-----------------------\r\n", CLS1_GetStdio()->stdOut);
  res = SHT11_SoftReset();
  if (res!=ERR_OK) {
    CLS1_SendStr("FAILED to reset device\r\n ", CLS1_GetStdio()->stdErr);
    for(;;){}
  }
  for(;;) {
    SHT11_Read(&temperature, &humidity);
    CLS1_SendStr("Temperature ", CLS1_GetStdio()->stdOut);
    buf[0] = '\0';
    UTIL1_strcatNum32sDotValue100(buf, sizeof(buf), temperature*100);
    CLS1_SendStr(buf, CLS1_GetStdio()->stdOut);
    CLS1_SendStr("°C, Humidity ", CLS1_GetStdio()->stdOut);
    buf[0] = '\0';
    UTIL1_strcatNum32sDotValue100(buf, sizeof(buf), humidity*100);
    CLS1_SendStr(buf, CLS1_GetStdio()->stdOut);
    CLS1_SendStr("%\r\n", CLS1_GetStdio()->stdOut);
    WAIT1_Waitms(1000);
    LED1_Neg();
  }
  /* For example: for(;;) { } */

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #28
0
void main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  APP_Run();

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #29
0
ファイル: ProcessorExpert.c プロジェクト: zhangsaisai/SEMG
/*!
 *     @brief
 *          The main function of the project.
 *     @param
 *          void
 *     @return
 *          int
 */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
    /* Write your local variable definition here */

    /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
    PE_low_level_init();
    /*** End of Processor Expert internal initialization.                    ***/

    /* Write your code here */
    /* For example: for(;;) { } */
    (void)TestApp_Init(); /* Initialize the USB Test Application */
    /* Initialize on-chip and peripheral devices */
#if DEBUG
    GPIOTest();
    printf("+UserInit begins...\n");
#endif
    UserInit();
#if DEBUG
    printf("-UserInit finished.\n");
#endif

#if DEBUG
    GPIOTest();
#endif
    
    Init_State = 200;//Init is OK
    /* The main loop */
    MainLoop();

    /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
コード例 #30
0
ファイル: main.c プロジェクト: cassis-han/Kehan_FSL_prj
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
   uint32_t      currentCounter = 0;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  hw_average_config.hwAverageCountMode = kAdc16HwAverageCountOf32;      //enable hardware average.
  ADC16_DRV_ConfigHwAverage(FSL_ADCONV1,&hw_average_config);
  ADC16_DRV_GetAutoCalibrationParam(FSL_ADCONV1,&calibration_param);

  calibrateParams();
  //ADC16_DRV_Init(FSL_ADCONV1, &adConv1_InitConfig0);

  LPTMR_DRV_SetTimerPeriodUs(FSL_LPTMR1,1000000);  // Set lptmr period
  printf("\r\nLPTMR is running!!\r\n");
  LPTMR_DRV_Start(FSL_LPTMR1);
  /* Write your code here */
  /* For example: for(;;) { } */
  while(1)
  {
      if(currentCounter != lptmrCounter)
      {
          currentCounter = lptmrCounter;
          printf("\r\nLPTMR interrupt No.%d \r\n",currentCounter);
          GPIO_DRV_TogglePinOutput(LEDRGB_GREEN);
      }
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/