Reduce unused function warnings

2.0.x
Scott Lahteine 5 years ago
parent 1fe195926f
commit fb579212ea

@ -114,9 +114,12 @@ void HAL_init(void);
inline void HAL_clear_reset_source(void) { MCUSR = 0; }
inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
extern "C" {
int freeMemory(void);
}
#pragma GCC diagnostic pop
// timers
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz

@ -156,7 +156,11 @@ void HAL_init(void);
// Utility functions
//
void _delay_ms(const int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
#pragma GCC diagnostic pop
#ifdef __cplusplus
extern "C" {

@ -92,7 +92,10 @@ uint8_t HAL_get_reset_source(void);
void _delay_ms(int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
#pragma GCC diagnostic pop
void analogWrite(pin_t pin, int value);

@ -81,7 +81,10 @@ extern HalSerial usb_serial;
inline void HAL_init(void) { }
// Utility functions
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
#pragma GCC diagnostic pop
// SPI: Extended functions which take a channel number (hardware SPI only)
/** Write single byte to specified SPI channel */

@ -111,7 +111,10 @@ extern "C" volatile uint32_t _millis;
//
// Utility functions
//
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
#pragma GCC diagnostic pop
//
// SPI: Extended functions taking a channel number (Hardware SPI only)

@ -132,11 +132,17 @@ void noTone(const pin_t _pin);
// Enable hooks into idle and setup for HAL
void HAL_init(void);
/*#define HAL_IDLETASK 1
void HAL_idletask(void);*/
/*
#define HAL_IDLETASK 1
void HAL_idletask(void);
*/
//
// Utility functions
//
FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
#pragma GCC diagnostic pop

@ -136,7 +136,7 @@ typedef int16_t pin_t;
// Public Variables
// ------------------------
/** result of last ADC conversion */
// result of last ADC conversion
extern uint16_t HAL_adc_result;
// ------------------------
@ -149,30 +149,35 @@ extern uint16_t HAL_adc_result;
// Enable hooks into setup for HAL
void HAL_init(void);
/** clear reset reason */
// Clear reset reason
void HAL_clear_reset_source (void);
/** reset reason */
// Reset reason
uint8_t HAL_get_reset_source(void);
void _delay_ms(const int delay);
extern "C" char* _sbrk(int incr);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static inline int freeMemory() {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
}
#pragma GCC diagnostic pop
//
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
//

@ -158,7 +158,7 @@ typedef int8_t pin_t;
// Public Variables
// ------------------------
/** result of last ADC conversion */
// Result of last ADC conversion
extern uint16_t HAL_adc_result;
// ------------------------
@ -174,14 +174,17 @@ extern uint16_t HAL_adc_result;
// Memory related
#define __bss_end __bss_end__
/** clear reset reason */
// Clear reset reason
void HAL_clear_reset_source(void);
/** reset reason */
// Reset reason
uint8_t HAL_get_reset_source(void);
void _delay_ms(const int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
/*
extern "C" {
int freeMemory(void);
@ -189,6 +192,7 @@ extern "C" {
*/
extern "C" char* _sbrk(int incr);
/*
static int freeMemory() {
volatile int top;
@ -197,9 +201,6 @@ static int freeMemory() {
}
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static int freeMemory() {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
@ -211,11 +212,11 @@ static int freeMemory() {
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
//

@ -37,7 +37,7 @@
#include <stdint.h>
#ifdef defined(STM32F4) && USBCON
#if defined(STM32F4) && USBCON
#include <USBSerial.h>
#endif
@ -100,8 +100,6 @@
#define NUM_SERIAL 1
#endif
#define _BV(b) (1 << (b))
/**
* TODO: review this to return 1 for pins that are not analog input
*/
@ -142,7 +140,7 @@ typedef int8_t pin_t;
// Public Variables
// ------------------------
/** result of last ADC conversion */
// Result of last ADC conversion
extern uint16_t HAL_adc_result;
// ------------------------
@ -154,14 +152,17 @@ extern uint16_t HAL_adc_result;
inline void HAL_init(void) { }
/** clear reset reason */
// Clear reset reason
void HAL_clear_reset_source (void);
/** reset reason */
// Reset reason
uint8_t HAL_get_reset_source(void);
void _delay_ms(const int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
/*
extern "C" {
int freeMemory(void);
@ -183,15 +184,17 @@ static int freeMemory() {
return &top - reinterpret_cast<char*>(_sbrk(0));
}
#pragma GCC diagnostic pop
//
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
//

@ -97,9 +97,12 @@ uint8_t HAL_get_reset_source(void);
FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
extern "C" {
int freeMemory(void);
}
#pragma GCC diagnostic pop
// SPI: Extended functions which take a channel number (hardware SPI only)

@ -95,24 +95,27 @@ typedef int8_t pin_t;
inline void HAL_init(void) { }
/** clear reset reason */
// Clear reset reason
void HAL_clear_reset_source(void);
/** reset reason */
// Reset reason
uint8_t HAL_get_reset_source(void);
FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
extern "C" {
int freeMemory(void);
}
#pragma GCC diagnostic pop
// SPI: Extended functions which take a channel number (hardware SPI only)
/** Write single byte to specified SPI channel */
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
// ADC

Loading…
Cancel
Save