Skip to content

Commit

Permalink
Merge pull request #10480 from kjbracey-arm/spi_prime
Browse files Browse the repository at this point in the history
SPI: Prime asynch transaction buffer on construction
  • Loading branch information
0xc0170 authored May 14, 2019
2 parents a2cde2e + 3fbad10 commit 64575fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ void SPI::_do_construct()
_peripheral->name = name;
}
core_util_critical_section_exit();

#if DEVICE_SPI_ASYNCH && TRANSACTION_QUEUE_SIZE_SPI
// prime the SingletonPtr, so we don't have a problem trying to
// construct the buffer if asynch operation initiated from IRQ
_peripheral->transaction_buffer.get();
#endif
// we don't need to _acquire at this stage.
// this will be done anyway before any operation.
}
Expand Down

0 comments on commit 64575fe

Please sign in to comment.