Page 319 - MDP2020-1
P. 319

················································································  명장양성프로젝트  【MDP】  과제발표회  자료집  Ⅰ    |  313


                *  @brief    The  application  entry  point.
                *  @retval  int
                */
            int  main(void)

            {
                /*  USER  CODE  BEGIN  1  */


                /*  USER  CODE  END  1  */



                /*                                                                                      MCU
            Configuration--------------------------------------------------------*/


                /*  Reset  of  all  peripherals,  Initializes  the  Flash  interface  and  the  Systick.  */
                HAL_Init();



                /*  USER  CODE  BEGIN  Init  */


                /*  USER  CODE  END  Init  */



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


                /*  USER  CODE  BEGIN  SysInit  */



                /*  USER  CODE  END  SysInit  */


                /*  Initialize  all  configured  peripherals  */
                MX_GPIO_Init();
                MX_USART2_UART_Init();

                /*  USER  CODE  BEGIN  2  */
                HAL_UART_Receive_IT(&huart2,receive_data,2);
                /*  USER  CODE  END  2  */


                /*  Infinite  loop  */

                /*  USER  CODE  BEGIN  WHILE  */
                while  (1)
                {
                      if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0)  ==  1){
                            LED(0);

                            LED_BAR(1);
                            Motor(0);
   314   315   316   317   318   319   320   321   322   323   324