Demo entry 6633606

py

   

Submitted by anonymous on Aug 04, 2017 at 03:58
Language: C. Code size: 465 Bytes.

rt_size_t stm32_rb_lock_in(struct rt_serial_device *serial,
					 struct rt_ringbuffer 	 *rb,
					 const rt_uint8_t 		 *ptr, 
					 rt_uint16_t 			 length)
{
    rt_uint16_t size;
    struct stm32_uart* uart;
	
	uart = (struct stm32_uart *)serial->parent.user_data;
	
	USART_ITConfig(uart->uart_device, USART_IT_TXE, DISABLE);
	
	size = rt_ringbuffer_put(rb,ptr,length);

	USART_ITConfig(uart->uart_device, USART_IT_TXE, ENABLE);
	
	return size;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).