aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-04-25 18:17:52 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-04-25 18:17:52 -0400
commit3bd0b34803173100db3699e62c021fb04042c495 (patch)
tree06afab2539b65b2415fb55bc99826248fe60bf95
parent4ccbeb08e64b6bc7cee1f54a04001eff778b4282 (diff)
downloadlibrambutan-3bd0b34803173100db3699e62c021fb04042c495.tar.gz
librambutan-3bd0b34803173100db3699e62c021fb04042c495.zip
Fixed two compiler warnings in spi
-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) ||