From 8edeaaa21e8c96b3c7683daa0b3c240b82d13b78 Mon Sep 17 00:00:00 2001
From: Jared Boone <jboone@earfeast.com>
Date: Tue, 4 Nov 2014 18:25:00 -0800
Subject: [PATCH 12/68] W25Q80BV: Move SPI functions to top of file, since
 they're static and used later.

---
 firmware/common/w25q80bv_drv.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/firmware/common/w25q80bv_drv.c b/firmware/common/w25q80bv_drv.c
index d0500b5..1f55512 100644
--- a/firmware/common/w25q80bv_drv.c
+++ b/firmware/common/w25q80bv_drv.c
@@ -30,6 +30,21 @@
 #include <libopencm3/lpc43xx/gpio.h>
 #include <libopencm3/lpc43xx/rgu.h>
 
+static void w25q80bv_spi_select(w25q80bv_hw_t* const hw) {
+	(void)hw;
+	gpio_clear(PORT_SSP0_SSEL, PIN_SSP0_SSEL);
+}
+
+static void w25q80bv_spi_unselect(w25q80bv_hw_t* const hw) {
+	(void)hw;
+	gpio_set(PORT_SSP0_SSEL, PIN_SSP0_SSEL);
+}
+
+static uint16_t w25q80bv_spi_transfer(w25q80bv_hw_t* const hw, const uint16_t tx_data) {
+	(void)hw;
+	return ssp_transfer(SSP0_NUM, tx_data);
+}
+
 void w25q80bv_spi_init(w25q80bv_hw_t* const hw) {
 	const uint8_t serial_clock_rate = 2;
 	const uint8_t clock_prescale_rate = 2;
@@ -74,18 +89,3 @@ void w25q80bv_spi_init(w25q80bv_hw_t* const hw) {
 			SSP_MASTER,
 			SSP_SLAVE_OUT_ENABLE);
 }
-
-void w25q80bv_spi_select(w25q80bv_hw_t* const hw) {
-	(void)hw;
-	gpio_clear(PORT_SSP0_SSEL, PIN_SSP0_SSEL);
-}
-
-void w25q80bv_spi_unselect(w25q80bv_hw_t* const hw) {
-	(void)hw;
-	gpio_set(PORT_SSP0_SSEL, PIN_SSP0_SSEL);
-}
-
-uint16_t w25q80bv_spi_transfer(w25q80bv_hw_t* const hw, const uint16_t tx_data) {
-	(void)hw;
-	return ssp_transfer(SSP0_NUM, tx_data);
-}
-- 
2.1.4

