aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmaple/spi.c4
-rw-r--r--wirish/comm/HardwareSPI.cpp2
2 files changed, 2 insertions, 4 deletions
diff --git a/libmaple/spi.c b/libmaple/spi.c
index 5a77b03..ddc8346 100644
--- a/libmaple/spi.c
+++ b/libmaple/spi.c
@@ -65,7 +65,7 @@ static const spi_dev spi_dev2 = {
.mosi_pin = 15
};
-static void spi_gpio_cfg(spi_dev *dev);
+static void spi_gpio_cfg(const spi_dev *dev);
/**
* @brief Initialize a spi peripheral
@@ -125,7 +125,7 @@ void spi_tx(uint32 spi_num, uint8 data) {
;
}
-static void spi_gpio_cfg(spi_dev *dev) {
+static void spi_gpio_cfg(const spi_dev *dev) {
gpio_set_mode(dev->port, dev->sck_pin, GPIO_MODE_AF_OUTPUT_PP);
gpio_set_mode(dev->port, dev->miso_pin, GPIO_MODE_AF_OUTPUT_PP);
gpio_set_mode(dev->port, dev->mosi_pin, GPIO_MODE_AF_OUTPUT_PP);
diff --git a/wirish/comm/HardwareSPI.cpp b/wirish/comm/HardwareSPI.cpp
index 49dad71..e083ac1 100644
--- a/wirish/comm/HardwareSPI.cpp
+++ b/wirish/comm/HardwareSPI.cpp
@@ -79,8 +79,6 @@ static const uint32 prescaleFactors[MAX_SPI_FREQS] = {
*/
void HardwareSPI::begin(SPIFrequency freq, uint32 endianness, uint32 mode) {
uint32 spi_num = this->spi_num;
- uint32 high_speed = 0;
- uint32 index;
uint32 prescale;
if ((freq >= MAX_SPI_FREQS) ||