Beispiel #1
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */ 
int main(void)
{  
  /* STM32F0xx HAL library initialization:
       - Configure the Flash prefetch
       - Systick timer is configured by default as source of time base, but user 
         can eventually implement his proper time base source (a general purpose 
         timer for example or other time source), keeping in mind that Time base 
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
         handled in milliseconds basis.
       - Low Level Initialization
     */
  HAL_Init();  
  
  /* Configure the system clock = 48 MHz */
  SystemClock_Config();
  
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /* Init the STemWin GUI Library */
  GUI_Init();
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);
    
  MainTask();
  
  /* Infinite loop */
  for(;;);
}
Beispiel #2
0
void rt_init_thread_entry(void* parameter)
{
    /* GDB STUB */
#ifdef RT_USING_GDB
    gdb_set_device("uart6");
    gdb_start();
#endif

    /* LwIP Initialization */
#ifdef RT_USING_LWIP
    {
        extern void lwip_sys_init(void);

        /* register ethernetif device */
        eth_system_device_init();

        rt_hw_stm32_eth_init();

        /* init lwip system */
        lwip_sys_init();
        rt_kprintf("TCP/IP initialized!\n");
    }
#endif
		
		rt_hw_lcd_init("lcd", "spi1");
		//GUI_Init();            /* ³õʼ»¯ST-emwin */ 
	while (1)
    {
			  rt_kprintf("thread1\r\n");
			  MainTask();

    }
}
/* StartMainTask function */
void StartMainTask(void const * argument)
{

  /* USER CODE BEGIN StartMainTask */
  /* Infinite loop */
  MainTask();
  /* USER CODE END StartMainTask */
}
Beispiel #4
0
int main(void){
	SystemInit();
  	UB_STemWIN_init();
  	MainTask();
	/* Program never will reach bellow this point until emWin terminates! */
 	while(1){
 	}
}
Beispiel #5
0
void User_Task_Func(void *p_arg)
{
	(void)p_arg;
	while(1)
	{
//		printf("user task start.\n\r");
		MainTask();
	}
}
Beispiel #6
0
int main (void) {

  MPU_Config();                             /* Configure the MPU              */
  CPU_CACHE_Enable();                       /* Enable the CPU Cache           */
  HAL_Init();                               /* Initialize the HAL Library     */
  BSP_SDRAM_Init();                         /* Initialize BSP SDRAM           */
  SystemClock_Config();                     /* Configure the System Clock     */
  init_filesystem();                        /* Inital rl-flash Librart        */

  MainTask();
  for (;;);
}
Beispiel #7
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
  /* Configure hardware */
  HardwareConfigure();

  /* Main task */
  MainTask();

  /* Never run to here ! */
  printf_1("\r\nMake sure all task done !");
  while(1){};
}
static  void  App_Task1(void *p_arg)
{
	(void)p_arg;
	 LED_GPIO_Conf();
	GUI_Init();
	GUI_SetBkColor(GUI_RED);
	GUI_SetColor(GUI_BLUE);
	GUI_Clear();
	while(1)
	{
     	LED0(On);
		OSTimeDly(500);
		LED0(Off);
		OSTimeDly(500);
		MainTask();
	}	
}
static  void  App_TaskStart (void *p_arg)
{	 
    (void)p_arg;                                               /* Initialize BSP functions.                            */
    OS_CPU_SysTickInit();                                       /* Initialize the SysTick.                              */
     BSP_Init(); 
#if (OS_TASK_STAT_EN > 0)
    OSStatInit();                                               /* Determine CPU capacity.                              */
#endif

	/* 在此可创建事件 */

	/* 在此可创建其他任务 */
    //App_TaskCreate();	
    LED_GPIO_Conf();
    while (1) 
	{   
     	LED1(On);
 		OSTimeDly(300);
 		LED1(Off);
 		OSTimeDly(300);
		MainTask();
    }
}
Beispiel #10
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
    /* STM32F4xx HAL library initialization:
         - Configure the Flash prefetch, instruction and Data caches
         - Configure the Systick to generate an interrupt each 1 msec
         - Set NVIC Group Priority to 4
         - Global MSP (MCU Support Package) initialization
       */
    HAL_Init();

    /* Configure the system clock 168 MHz */
    SystemClock_Config();

    /***********************************************************/

    /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
    uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;

    /* Set TIMx instance */
    TimHandle.Instance = TIM3;

    /* Initialize TIM3 peripheral as follows:
         + Period = 500 - 1
         + Prescaler = ((SystemCoreClock/2)/10000) - 1
         + ClockDivision = 0
         + Counter direction = Up
    */
    TimHandle.Init.Period = 500 - 1;
    TimHandle.Init.Prescaler = uwPrescalerValue;
    TimHandle.Init.ClockDivision = 0;
    TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
    if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /*##-2- Start the TIM Base generation in interrupt mode ####################*/
    /* Start Channel1 */
    if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /***********************************************************/

    /* Initialize LCD and LEDs */
    BSP_Config();

    /* Init the STemWin GUI Library */
    GUI_Init();
    GUI_Initialized = 1;

    /* Activate the use of memory device feature */
    WM_SetCreateFlags(WM_CF_MEMDEV);

    MainTask();

    /* Infinite loop */
    for(;;);
}
Beispiel #11
0
static void RunGUITask(void) {   
	GUI_Touch_Config();
	while (1)
		MainTask();
}
Beispiel #12
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */ 
int main(void)
{
  /* Enable the CPU Cache */
  CPU_CACHE_Enable();

  /* STM32F7xx HAL library initialization:
       - Configure the Flash ART accelerator on ITCM interface
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();  
  
  /* Configure the system clock to 200 MHz */
  SystemClock_Config(); 
  
  /* Initialize LCD and LEDs */
  BSP_Config();

  /***********************************************************/
  
  /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
  uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;
  
  /* Set TIMx instance */
  TimHandle.Instance = TIM3;
   
  /* Initialize TIM3 peripheral as follows:
       + Period = 500 - 1
       + Prescaler = ((SystemCoreClock/2)/10000) - 1
       + ClockDivision = 0
       + Counter direction = Up
  */
  TimHandle.Init.Period = 500 - 1;
  TimHandle.Init.Prescaler = uwPrescalerValue;
  TimHandle.Init.ClockDivision = 0;
  TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
  if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /*##-2- Start the TIM Base generation in interrupt mode ####################*/
  /* Start Channel1 */
  if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /***********************************************************/
  
  /* Init the STemWin GUI Library */
  BSP_SDRAM_Init(); /* Initializes the SDRAM device */
  __HAL_RCC_CRC_CLK_ENABLE(); /* Enable the CRC Module */
  GUI_Init();
  
  GUI_DispStringAt("Starting...", 0, 0);

  GUI_Initialized = 1;
  
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);
    
  MainTask();
  
  /* Infinite loop */
  for(;;);
}
Beispiel #13
0
void main(void) {
  MainTask();
}
/*********************************************************************
*
*       _Thread
*/
static DWORD __stdcall _Thread(void* Parameter) {
  /* Execute the target application to be simulated */
  MainTask();
  return 0;
}