src/fpm_driver.c
uint16_t fpm_uart_read( uint8_t *bytes, uint16_t len ) {
  int read = 0;
  for ( read = 0; read < len; ++read ) {
    if ( fprint_rb.pos == fprint_rb.ext ) { break; }
    bytes[ read ] = fprint_rb.buf[ fprint_rb.pos ];
    int next_pos = fprint_rb.pos + 1;
    if ( next_pos >= RINGBUF_LEN ) { next_pos = 0; }
    fprint_rb.pos = next_pos;
  }
  // Return the number of bytes actually read.
  return read;
}
// Receive a number of bytes over UART.
Receive a number of bytes over UART.
Receive a number of bytes over UART .
uint16_t fpm_uart_read( uint8_t *bytes, uint16_t len ) {
  int read = 0;
  for ( read = 0; read < len; ++read ) {
    if ( fprint_rb.pos == fprint_rb.ext ) { break; }
    bytes[ read ] = fprint_rb.buf[ fprint_rb.pos ];
    int next_pos = fprint_rb.pos + 1;
    if ( next_pos >= RINGBUF_LEN ) { next_pos = 0; }
    fprint_rb.pos = next_pos;
  }
  return read;
}
uint16_t fpm_uart_read ( uint8_t * bytes , uint16_t len ) { int read = 0 ; for ( read = 0 ; read < len ; ++ read ) { if ( fprint_rb . pos == fprint_rb . ext ) { break ; } bytes [ read ] = fprint_rb . buf [ fprint_rb . pos ] ; int next_pos = fprint_rb . pos + 1 ; if ( next_pos >= RINGBUF_LEN ) { next_pos = 0 ; } fprint_rb . pos = next_pos ; } return read ; }
Receive a number of bytes over UART.
Receive a number of bytes over UART .
// Return the number of bytes actually read.