From 1dd5cbb445a5a9b31465e58cc2b0330dadfb1325 Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Wed, 2 Nov 2016 21:55:19 -0700 Subject: [PATCH] Wunused-function: Fixed all unused functions in src This commit addresses all warnings emitted from -Wunused-function in the C++ src. Signed-off-by: Noel Eck --- src/bmp280/bmp280.cxx | 5 --- src/nrf8001/hal_aci_tl.cpp | 87 +++++++++++++++++++------------------- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/src/bmp280/bmp280.cxx b/src/bmp280/bmp280.cxx index 50027d28..a8bd966d 100644 --- a/src/bmp280/bmp280.cxx +++ b/src/bmp280/bmp280.cxx @@ -42,11 +42,6 @@ using namespace std; // conversion from fahrenheit to celsius and back -static float f2c(float f) -{ - return ((f - 32.0) / (9.0 / 5.0)); -} - static float c2f(float c) { return (c * (9.0 / 5.0) + 32.0); diff --git a/src/nrf8001/hal_aci_tl.cpp b/src/nrf8001/hal_aci_tl.cpp index 07fdbe85..e029109f 100644 --- a/src/nrf8001/hal_aci_tl.cpp +++ b/src/nrf8001/hal_aci_tl.cpp @@ -39,7 +39,7 @@ static const uint8_t reverse_lookup[] = { 0, 8, 4, 12, 2, 10, 6, 14,1, 9, 5, 13 static void m_aci_data_print(hal_aci_data_t *p_data); static void m_aci_event_check(void); -static void m_aci_isr(void); +//static void m_aci_isr(void); static void m_aci_pins_set(aci_pins_t *a_pins_ptr); static inline void m_aci_reqn_disable (void); static inline void m_aci_reqn_enable (void); @@ -72,48 +72,49 @@ void m_aci_data_print(hal_aci_data_t *p_data) /* Interrupt service routine called when the RDYN line goes low. Runs the SPI transfer. */ -static void m_aci_isr(void) -{ - hal_aci_data_t data_to_send; - hal_aci_data_t received_data; - - // Receive from queue - if (!aci_queue_dequeue_from_isr(&aci_tx_q, &data_to_send)) - { - /* queue was empty, nothing to send */ - data_to_send.status_byte = 0; - data_to_send.buffer[0] = 0; - } - - // Receive and/or transmit data - m_aci_spi_transfer(&data_to_send, &received_data); - - if (!aci_queue_is_full_from_isr(&aci_rx_q) && !aci_queue_is_empty_from_isr(&aci_tx_q)) - { - m_aci_reqn_enable(); - } - - // Check if we received data - if (received_data.buffer[0] > 0) - { - if (!aci_queue_enqueue_from_isr(&aci_rx_q, &received_data)) - { - /* Receive Buffer full. - Should never happen. - Spin in a while loop. - */ - while(1); - } - - // Disable ready line interrupt until we have room to store incoming messages - if (aci_queue_is_full_from_isr(&aci_rx_q)) - { - // detachInterrupt(a_pins_local_ptr->interrupt_number); - } - } - - return; -} +// Not used, commenting out. Noel Eck 2016/11/02 +//static void m_aci_isr(void) +//{ +// hal_aci_data_t data_to_send; +// hal_aci_data_t received_data; +// +// // Receive from queue +// if (!aci_queue_dequeue_from_isr(&aci_tx_q, &data_to_send)) +// { +// /* queue was empty, nothing to send */ +// data_to_send.status_byte = 0; +// data_to_send.buffer[0] = 0; +// } +// +// // Receive and/or transmit data +// m_aci_spi_transfer(&data_to_send, &received_data); +// +// if (!aci_queue_is_full_from_isr(&aci_rx_q) && !aci_queue_is_empty_from_isr(&aci_tx_q)) +// { +// m_aci_reqn_enable(); +// } +// +// // Check if we received data +// if (received_data.buffer[0] > 0) +// { +// if (!aci_queue_enqueue_from_isr(&aci_rx_q, &received_data)) +// { +// /* Receive Buffer full. +// Should never happen. +// Spin in a while loop. +// */ +// while(1); +// } +// +// // Disable ready line interrupt until we have room to store incoming messages +// if (aci_queue_is_full_from_isr(&aci_rx_q)) +// { +// // detachInterrupt(a_pins_local_ptr->interrupt_number); +// } +// } +// +// return; +//} /* Checks the RDYN line and runs the SPI transfer if required.