Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using multiple device with SPI connection problem #16

Closed
AzwarPrihastomo opened this issue Apr 12, 2021 · 4 comments
Closed

using multiple device with SPI connection problem #16

AzwarPrihastomo opened this issue Apr 12, 2021 · 4 comments

Comments

@AzwarPrihastomo
Copy link

I just found bug on this code
if we using multiple BMP388 with SPI
i found the reading on first initialized device is error

after i check the pointer for SPI is on global variable
Adafruit_SPIDevice *spi_dev = NULL; ///< Global SPI interface pointer

so i move this variable on local class variable

and change this 2 function
//
/*!
@brief Reads 8 bit values over SPI
*/
/
/
static int8_t spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len,
void *intf_ptr) {
((Adafruit_SPIDevice)intf_ptr)*->write_then_read(&reg_addr, 1, reg_data, len, 0xFF);
return 0;
}

//
/*!
@brief Writes 8 bit values over SPI
*/
/
/
static int8_t spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len,
void *intf_ptr) {
((Adafruit_SPIDevice)intf_ptr)*->write((uint8_t *)reg_data, len, &reg_addr, 1);

return 0;
}

it solve the issue

Thanks

@sylvanoMTL
Copy link

I am stuck with this too, Would you mind to provide a bit more detail?

@ladyada
Copy link
Member

ladyada commented Jun 21, 2021

you can try #19

@caternuson
Copy link
Contributor

Please update to the 2.1.0 release and see if that resolves this issue:
https://github.com/adafruit/Adafruit_BMP3XX/releases/tag/2.1.0

@caternuson
Copy link
Contributor

Closing due to lack of response. Linked release above should resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants