adafruit / Adafruit_FRAM_SPI

Driver for Adafruit's SPI-Based FRAM Breakouts
Other
34 stars 30 forks source link

write method const pointer argument #25

Closed yilungao closed 2 years ago

yilungao commented 2 years ago

https://github.com/adafruit/Adafruit_FRAM_SPI/blob/44f5b34c8172dafa34a6ab44cb526b7b705552d9/Adafruit_FRAM_SPI.h#L52

Similar to this issue it would be nice if the write method takes const uint8_t* instead of uint8_t*. i.e. changing the method to void write(uint32_t addr, const uint8_t *values, size_t count);

The underlying method SPIClass::transferBytes also takes const uint8_t*.

I understand this would require changing the code in the Adafruit_BusIO library as well but given Adafruit_I2CDevice write() already takes const pointers, it would be nice to be consistent and fix the Adafruit_SPIDevice as well.

Can submit a PR if that works.

hathach commented 2 years ago

yup, please submit PR, I will help with reviewing if there is any issue.

zencow commented 2 years ago

The update to Adafruit_BusIO broke my project. It doesn't compile. I submitted an Issue.