Skip to content

Commit

Permalink
[nasa/nos3#88] Update sim/libspi.c to use max spi buses instead of de…
Browse files Browse the repository at this point in the history
…vices for pthread_mutexs;
  • Loading branch information
jlucas9 committed Jul 26, 2023
1 parent dad41dd commit 4a8d2f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sim/src/libspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void nos_init_spi_link(void)
{
// Init the mutexes for chip select
int i;
for(i = 0; i < NUM_SPI_DEVICES; i++)
for(i = 0; i < MAX_SPI_BUSES; i++)
{
if (pthread_mutex_init(&spi_bus_mutex[i], NULL) != 0)
{
Expand All @@ -59,7 +59,7 @@ void nos_destroy_spi_link(void)
{
/* clean up spi buses */
int i;
for(i = 0; i < NUM_SPI_DEVICES; i++)
for(i = 0; i < MAX_SPI_BUSES; i++)
{
NE_SpiHandle *dev = spi_device[i];
if(dev) NE_spi_close(&dev);
Expand Down

0 comments on commit 4a8d2f8

Please sign in to comment.