Optimize SPI functions, lowering ROM usage by 70 bytes.

- Have only one transfer function, to minimize duplicate code.
- Remove address assignments that does not make a difference.
This commit is contained in:
Daniel Jobson 2024-09-30 11:29:08 +02:00
parent 9fabff90cb
commit 6ac874584d
No known key found for this signature in database
GPG key ID: 3707A9DBF4BB8F1A
3 changed files with 29 additions and 41 deletions

View file

@ -8,8 +8,7 @@
#include <stdint.h>
int spi_ready(void);
int spi_write(uint8_t *cmd, size_t size_cmd, uint8_t *data, size_t size_data);
int spi_transfer(uint8_t *tx_buf, size_t tx_size, uint8_t *rx_buf,
size_t rx_size);
int spi_transfer(uint8_t *cmd, size_t cmd_size, uint8_t *tx_buf, size_t tx_size,
uint8_t *rx_buf, size_t rx_size);
#endif