Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1.  /* USER CODE BEGIN 6 */
  2.     static uint8_t sprejetih=0;
  3.     uint8_t f;uint8_t stevec=0;char niz[6] ="prizgi";
  4.    
  5.     sprejetih+=*Len;
  6.     for (f=0; f<*Len; f++)//zapisujemo v NaΕ‘ buffer
  7.     {
  8.         UserTxBufferFS[f]=Buf[f]+1;
  9.     }
  10.     if(sprejetih==6)
  11.     {
  12.         HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12, GPIO_PIN_SET);
  13.         f=0;
  14.         while(stevec==0)
  15.         {
  16.                 if(UserTxBufferFS[f]!=niz[f])
  17.                 {
  18.                     HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, GPIO_PIN_SET);
  19.                     stevec=1;
  20.                 }
  21.                 f++;
  22.         }
  23.     }
  24.     CDC_Transmit_FS(UserTxBufferFS,*Len);
  25.      USBD_CDC_ReceivePacket(&hUsbDeviceFS);
  26.   return (USBD_OK);
  27.   /* USER CODE END 6 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement