Reduce need for UNUSED

This commit is contained in:
Scott Lahteine
2019-09-30 21:44:07 -05:00
parent e3ff27c95a
commit e3fd0519b3
31 changed files with 104 additions and 143 deletions

View File

@ -146,8 +146,7 @@ extern "C" {
#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B)
#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B)
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
UNUSED(frequency);
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
switch (timer_num) {
case STEP_TIMER_NUM:
// waveform generation = 0100 = CTC

View File

@ -184,15 +184,10 @@ void spiBegin() {
// nop to tune soft SPI timing
#define nop asm volatile ("\tnop\n")
// Set SPI rate
void spiInit(uint8_t spiRate) {
UNUSED(spiRate); // nothing to do
}
void spiInit(uint8_t) { /* do nothing */ }
// Begin SPI transaction, set clock, bit order, data mode
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
UNUSED(spiBeginTransaction); // nothing to do
}
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
// Soft SPI receive byte
uint8_t spiRec() {

View File

@ -151,13 +151,12 @@
(((uint32_t)(addr) & 0xF0000000) + 0x02000000 + ((uint32_t)(addr)&0xFFFFF)*32 + (bit)*4)
// run at ~8 .. ~10Mhz - Rx version (Tx line not altered)
static uint8_t spiTransferRx0(uint8_t bout) { // using Mode 0
static uint8_t spiTransferRx0(uint8_t) { // using Mode 0
uint32_t bin = 0;
uint32_t work = 0;
uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */
uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */
uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
UNUSED(bout);
/* The software SPI routine */
__asm__ __volatile__(

View File

@ -55,12 +55,9 @@ static int pending_char = -1;
#endif
// Public Methods
void MarlinSerialUSB::begin(const long baud_setting) {
UNUSED(baud_setting);
}
void MarlinSerialUSB::begin(const long) {}
void MarlinSerialUSB::end() {
}
void MarlinSerialUSB::end() {}
int MarlinSerialUSB::peek() {
if (pending_char >= 0)

View File

@ -33,19 +33,12 @@ Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
return CTRL_GOOD;
}
bool sd_mmc_spi_unload(bool unload) {
UNUSED(unload);
return true;
}
bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() {
return false;
}
bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return true;
return false;
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
}
#if ACCESS_USB == true

View File

@ -25,4 +25,4 @@
void watchdog_init();
// Reset watchdog.
inline void HAL_watchdog_refresh() { }
inline void HAL_watchdog_refresh() {}

View File

@ -78,7 +78,7 @@ extern HalSerial usb_serial;
#define ENABLE_ISRS()
#define DISABLE_ISRS()
inline void HAL_init() { }
inline void HAL_init() {}
// Utility functions
#pragma GCC diagnostic push

View File

@ -83,9 +83,9 @@ public:
HalSerial() { host_connected = true; }
void begin(int32_t baud) { }
void begin(int32_t) {}
void end() { }
void end() {}
int peek() {
uint8_t value;

View File

@ -49,7 +49,7 @@ public:
{
}
void end() { }
void end() {}
#if ENABLED(EMERGENCY_PARSER)
bool recv_callback(const char c) override {

View File

@ -104,17 +104,11 @@ extern "C" {
// ADC
// ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin);
}
// TODO: Make sure this doesn't cause any delay
void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); }
uint16_t HAL_adc_get_result() {
return HAL_adc_result;
}
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
void flashFirmware(int16_t value) {
UNUSED(value);
NVIC_SystemReset();
}
void flashFirmware(int16_t) { NVIC_SystemReset(); }
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

View File

@ -150,7 +150,7 @@ extern uint16_t HAL_adc_result;
// Memory related
#define __bss_end __bss_end__
inline void HAL_init() { }
inline void HAL_init() {}
// Clear reset reason
void HAL_clear_reset_source();

View File

@ -87,7 +87,7 @@ typedef int8_t pin_t;
#undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr)))
inline void HAL_init() { }
inline void HAL_init() {}
// Clear the reset reason
void HAL_clear_reset_source();

View File

@ -93,7 +93,7 @@ typedef int8_t pin_t;
#undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr)))
inline void HAL_init() { }
inline void HAL_init() {}
// Clear reset reason
void HAL_clear_reset_source();

View File

@ -53,7 +53,7 @@
FORCE_INLINE static void DELAY_CYCLES(const uint32_t x) {
const uint32_t endCycles = getCycleCount() + x;
while (PENDING(getCycleCount(), endCycles)) { }
while (PENDING(getCycleCount(), endCycles)) {}
}
#else