Exemple #1
0
void UsbMidiModule::_poll()
{
	midi_event_t midiEvent;
	int numReceived;

	while (numReceived = USB_Recv(getOutEndpointId(), &midiEvent, sizeof(midiEvent)))
	{
		// MIDI USB messages are 4 bytes in size.
		if (numReceived != 4)
			return;

		// They get decoded to up to 3 MIDI Serial bytes.
		u8 data[3];

		unsigned count = UsbToMidi::process(midiEvent, data);

		if (m_midiInFifo.hasSpaceFor(count))
		{
			for (unsigned i=0; i<count; ++i)
			{
				m_midiInFifo.push(data[i]);
			}
		}
	}
}
extern "C" void UART1_IRQHandler()
{
  Uart *pUart = BT_USART ;
  if ( pUart->UART_SR & UART_SR_TXBUFE ) {
    pUart->UART_IDR = UART_IDR_TXBUFE ;
    pUart->UART_PTCR = US_PTCR_TXTDIS ;
    Current_bt->ready = 0 ;
  }
  if ( pUart->UART_SR & UART_SR_RXRDY ) {
    btRxFifo.push(pUart->UART_RHR);
  }
}
Exemple #3
0
extern "C" void HEARTBEAT_USART_IRQHandler()
{
  uint32_t status;
  uint8_t data;

  status = HEARTBEAT_USART->SR;

  while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
    data = HEARTBEAT_USART->DR;

    if (!(status & USART_FLAG_ERRORS))
      sbusFifo.push(data);

    status = HEARTBEAT_USART->SR;
  }
}
void produkuj()
{
	cout << "[A czeka na miejsce]" << endl;
	puste.down();
	
	cout << "[A chce wstawiac]" << endl;
	mutex.down();
		cout << "[A wstawia]";
		fifo.push('A');
		fifo.de();
		if(fifo.size() > 3)
		{
			min3.up();
		}
	mutex.up();
}
Exemple #5
0
extern "C" void USART2_IRQHandler()
{
  uint32_t status;
  uint8_t data;

  status = SPORT->SR;

  while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
    data = SPORT->DR;

    if (!(status & USART_FLAG_ERRORS))
      telemetryFifo.push(data);

    status = SPORT->SR;
  }
}
Exemple #6
0
extern "C" void HEARTBEAT_USART_IRQHandler()
{
  uint32_t status;
  uint8_t data;

  status = HEARTBEAT_USART->SR;

  while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
    data = HEARTBEAT_USART->DR;

    if (!(status & USART_FLAG_ERRORS)) {
      if (currentTrainerMode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE)
        sbusFifo.push(data);
    }

    status = HEARTBEAT_USART->SR;
  }
}
Exemple #7
0
extern "C" void UART0_IRQHandler()
{
  debugRxFifo.push(CONSOLE_USART->UART_RHR);
}
void btPushByte(uint8_t data)
{
  btTxFifo.push(data);
  CoSetFlag(btFlag); // Tell the Bt task something to do
}
Exemple #9
0
void debugPutc(const char c)
{
  debugTxFifo.push(c);
  USART_ITConfig(UART3, USART_IT_TXE, ENABLE);
}
void push(Fifo& fifo, T& seed)
{
    fifo.push(seed);
}
extern "C" void UART0_IRQHandler()
{
  serial2RxFifo.push(SECOND_SERIAL_UART->UART_RHR);
}