Skip to content

Commit

Permalink
Merge pull request #7770 from thinkyhead/bf2_HAL_cleanups_etc
Browse files Browse the repository at this point in the history
Some HAL formatting cleanup
  • Loading branch information
thinkyhead committed Sep 27, 2017
2 parents f582f1b + c2b1d51 commit baf0bd2
Show file tree
Hide file tree
Showing 52 changed files with 608 additions and 992 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/HAL_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/HAL_AVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

//void cli(void);

//void _delay_ms(int delay);
//void _delay_ms(const int delay);

inline void HAL_clear_reset_source(void) { MCUSR = 0; }
inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Originally from Arduino Sd2Card Library
* Copyright (C) 2009 by William Greiman
*/

/**
* Description: HAL for AVR - SPI functions
*
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static void pwm_details(uint8_t pin) {
SERIAL_PROTOCOL_SP(10);
#endif
}

#define PRINT_PORT(p) print_port(p)

#endif
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/HAL_DUE/HAL_Due.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* **************************************************************************
Marlin 3D Printer Firmware
Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -93,7 +93,7 @@ uint8_t HAL_get_reset_source (void) {
}
}

void _delay_ms(int delay_ms) {
void _delay_ms(const int delay_ms) {
// todo: port for Due?
delay(delay_ms);
}
Expand All @@ -112,7 +112,7 @@ int freeMemory() {
// ADC
// --------------------------------------------------------------------------

void HAL_adc_start_conversion(uint8_t adc_pin) {
void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin);
}

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/HAL_Due.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void HAL_clear_reset_source (void);
/** reset reason */
uint8_t HAL_get_reset_source (void);

void _delay_ms(int delay);
void _delay_ms(const int delay);

int freeMemory(void);

Expand Down Expand Up @@ -150,7 +150,7 @@ inline void HAL_adc_init(void) {}//todo
#define HAL_READ_ADC HAL_adc_result


void HAL_adc_start_conversion (uint8_t adc_pin);
void HAL_adc_start_conversion(const uint8_t adc_pin);

uint16_t HAL_adc_get_result(void);

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@
if(spiRate > 6) spiRate = 1;

#if MB(ALLIGATOR)
// Set SPI mode 1, clock, select not active after transfer, with delay between transfers
// Set SPI mode 1, clock, select not active after transfer, with delay between transfers
SPI_ConfigureNPCS(SPI0, SPI_CHAN_DAC,
SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDueDividors[spiRate]) |
SPI_CSR_DLYBCT(1));
// Set SPI mode 0, clock, select not active after transfer, with delay between transfers
// Set SPI mode 0, clock, select not active after transfer, with delay between transfers
SPI_ConfigureNPCS(SPI0, SPI_CHAN_EEPROM1, SPI_CSR_NCPHA |
SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDueDividors[spiRate]) |
SPI_CSR_DLYBCT(1));
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#ifdef ARDUINO_ARCH_SAM

#include "../../inc/MarlinConfig.h"

#if ENABLED(USE_WATCHDOG)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void HAL_adc_enable_channel(int pin) {
};
}

void HAL_adc_start_conversion(uint8_t adc_pin) {
void HAL_adc_start_conversion(const uint8_t adc_pin) {
if (adc_pin >= (NUM_ANALOG_INPUTS) || adc_pin_map[adc_pin].port == 0xFF) {
usb_serial.printf("HAL: HAL_adc_start_conversion: no pinmap for %d\n", adc_pin);
return;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ uint8_t spiRec(uint32_t chan);

void HAL_adc_init(void);
void HAL_adc_enable_channel(int pin);
void HAL_adc_start_conversion (uint8_t adc_pin);
void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void);

#endif // _HAL_LPC1768_H

0 comments on commit baf0bd2

Please sign in to comment.