MCPcopy Create free account
hub / github.com/kiibohd/controller / uart_serial_write

Function uart_serial_write

Bootloader/debug.c:169–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168
169int uart_serial_write( const void *buffer, uint32_t size )
170{
171 const uint8_t *data = (const uint8_t *)buffer;
172 uint32_t position = 0;
173
174 // While buffer is not empty and transmit buffer is
175 while ( position < size )
176 {
177#if defined(_kinetis_)
178 while ( !( UART_SFIFO & UART_SFIFO_TXEMPT ) ); // Wait till there is room to send
179 UART_D = data[position++];
180#elif defined(_sam_)
181 while ( !( UART_PERIPH->UART_SR & UART_SR_TXRDY ) ); //Wait till tx ready
182 UART0->UART_THR = data[position++];
183#endif
184 }
185
186 return 0;
187}
188
189
190int Output_putstr( char* str )

Callers 1

Output_putstrFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…