當前位置: 首頁>>代碼示例>>C++>>正文


C++ FifoByteCount函數代碼示例

本文整理匯總了C++中FifoByteCount函數的典型用法代碼示例。如果您正苦於以下問題:C++ FifoByteCount函數的具體用法?C++ FifoByteCount怎麽用?C++ FifoByteCount使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FifoByteCount函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: USB_SendSpace

//	Space in send EP
u8 USB_SendSpace(u8 ep)
{
	LockEP lock(ep);
	if (!ReadWriteAllowed())
		return 0;
	return 64 - FifoByteCount();
}
開發者ID:stefania11,項目名稱:digital_chimes,代碼行數:8,代碼來源:USBCore.cpp

示例2: USB_Flush

void 
USB_Flush(uint8_t ep)
{
  SetEP(ep);
  if (FifoByteCount())
    ReleaseTX();
}
開發者ID:Dzenik,項目名稱:Cosa,代碼行數:7,代碼來源:Core.cpp

示例3: USB_SendSpace

uint8_t 
USB_SendSpace(uint8_t ep)
{
  LockEP lock(ep);
  if (!ReadWriteAllowed()) return (0);
  return (64 - FifoByteCount());
}
開發者ID:Dzenik,項目名稱:Cosa,代碼行數:7,代碼來源:Core.cpp

示例4: USB_Recv

int 
USB_Recv(uint8_t ep, void* d, int len)
{
  if (!_usbConfiguration || len < 0) return (-1);
	
  LockEP lock(ep);
  uint8_t n = FifoByteCount();
  len = min(n,len);
  n = len;
  uint8_t* dst = (uint8_t*)d;
  while (n--)
    *dst++ = Recv8();
  if (len && !FifoByteCount())
    ReleaseRX();
  return (len);
}
開發者ID:Dzenik,項目名稱:Cosa,代碼行數:16,代碼來源:Core.cpp

示例5: USB_Recv

//	Non Blocking receive
//	Return number of bytes read
int USB_Recv(u8 ep, void* d, int len)
{
	if (!_usbConfiguration || len < 0)
		return -1;
	
	LockEP lock(ep);
	u8 n = FifoByteCount();
	len = min(n,len);
	n = len;
	u8* dst = (u8*)d;
	while (n--)
		*dst++ = Recv8();
	if (len && !FifoByteCount())	// release empty buffer
		ReleaseRX();
	
	return len;
}
開發者ID:stefania11,項目名稱:digital_chimes,代碼行數:19,代碼來源:USBCore.cpp

示例6: USB_SendSpace

//	Space in send EP
u8 USB_SendSpace(u8 ep)
{
	LockEP lock(ep);
	if (!ReadWriteAllowed())
		return 0;
	// subtract 1 from the EP size to never send a full packet,
	// this avoids dealing with ZLP's in USB_Send
	return USB_EP_SIZE - 1 - FifoByteCount();
}
開發者ID:Bouni,項目名稱:Arduino,代碼行數:10,代碼來源:USBCore.cpp

示例7: USBD_SendSpace

//	Space in send EP
uint8_t USBD_SendSpace(uint8_t ep)
{
	SetEP(ep);
	if (!ReadWriteAllowed())
  {
		return 0;
  }

	return 64 - FifoByteCount();
}
開發者ID:00alis,項目名稱:Arduino,代碼行數:11,代碼來源:udphs.c

示例8: USB_Available

//	Number of bytes, assumes a rx endpoint
u8 USB_Available(u8 ep)
{
	LockEP lock(ep);
	return FifoByteCount();
}
開發者ID:stefania11,項目名稱:digital_chimes,代碼行數:6,代碼來源:USBCore.cpp

示例9: USBD_Available

//	Number of bytes, assumes a rx endpoint
uint8_t USBD_Available(uint8_t ep)
{
	SetEP(ep);

	return FifoByteCount();
}
開發者ID:00alis,項目名稱:Arduino,代碼行數:7,代碼來源:udphs.c

示例10: USB_Available

uint8_t 
USB_Available(uint8_t ep)
{
  LockEP lock(ep);
  return (FifoByteCount());
}
開發者ID:Dzenik,項目名稱:Cosa,代碼行數:6,代碼來源:Core.cpp


注:本文中的FifoByteCount函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。