| 167 | |
| 168 | |
| 169 | int 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 | |
| 190 | int Output_putstr( char* str ) |
no outgoing calls
no test coverage detected
searching dependent graphs…