Browse Source

Init servo pins in HAL_init (#14425)

pull/1/head
Scott Lahteine 6 years ago
committed by GitHub
parent
commit
6664b90bbb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      Marlin/src/HAL/HAL_AVR/HAL.cpp
  2. 2
      Marlin/src/HAL/HAL_AVR/HAL.h
  3. 1
      Marlin/src/HAL/HAL_DUE/HAL.h
  4. 1
      Marlin/src/HAL/HAL_ESP32/HAL.h
  5. 2
      Marlin/src/HAL/HAL_LINUX/HAL.h
  6. 3
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  7. 18
      Marlin/src/HAL/HAL_LPC1768/main.cpp
  8. 1
      Marlin/src/HAL/HAL_STM32/HAL.h
  9. 5
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  10. 2
      Marlin/src/HAL/HAL_STM32F4/HAL.h
  11. 2
      Marlin/src/HAL/HAL_STM32F7/HAL.h
  12. 2
      Marlin/src/HAL/HAL_TEENSY31_32/HAL.h
  13. 2
      Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
  14. 2
      Marlin/src/Marlin.cpp

16
Marlin/src/HAL/HAL_AVR/HAL.cpp

@ -67,6 +67,22 @@
// Public functions // Public functions
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
void HAL_init(void) {
// Init Servo Pins
#if PIN_EXISTS(SERVO0)
OUT_WRITE(SERVO0_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO1)
OUT_WRITE(SERVO1_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO2)
OUT_WRITE(SERVO2_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO3)
OUT_WRITE(SERVO3_PIN, LOW);
#endif
}
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "../../sd/SdFatUtil.h" #include "../../sd/SdFatUtil.h"

2
Marlin/src/HAL/HAL_AVR/HAL.h

@ -109,6 +109,8 @@ typedef int8_t pin_t;
// Public functions // Public functions
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
void HAL_init(void);
//void cli(void); //void cli(void);
//void _delay_ms(const int delay); //void _delay_ms(const int delay);

1
Marlin/src/HAL/HAL_DUE/HAL.h

@ -153,7 +153,6 @@ void noTone(const pin_t _pin);
// Enable hooks into idle and setup for HAL // Enable hooks into idle and setup for HAL
#define HAL_IDLETASK 1 #define HAL_IDLETASK 1
#define HAL_INIT 1
void HAL_idletask(void); void HAL_idletask(void);
void HAL_init(void); void HAL_init(void);

1
Marlin/src/HAL/HAL_ESP32/HAL.h

@ -123,7 +123,6 @@ void HAL_adc_start_conversion(uint8_t adc_pin);
// Enable hooks into idle and setup for HAL // Enable hooks into idle and setup for HAL
#define HAL_IDLETASK 1 #define HAL_IDLETASK 1
#define HAL_INIT 1
#define BOARD_INIT() HAL_init_board(); #define BOARD_INIT() HAL_init_board();
void HAL_idletask(void); void HAL_idletask(void);
void HAL_init(void); void HAL_init(void);

2
Marlin/src/HAL/HAL_LINUX/HAL.h

@ -82,6 +82,8 @@ extern HalSerial usb_serial;
#define ENABLE_ISRS() #define ENABLE_ISRS()
#define DISABLE_ISRS() #define DISABLE_ISRS()
inline void HAL_init(void) { }
// Utility functions // Utility functions
int freeMemory(void); int freeMemory(void);

3
Marlin/src/HAL/HAL_LPC1768/HAL.h

@ -27,9 +27,8 @@
*/ */
#define CPU_32_BIT #define CPU_32_BIT
#define HAL_INIT
void HAL_init(); void HAL_init(void);
#include <stdint.h> #include <stdint.h>
#include <stdarg.h> #include <stdarg.h>

18
Marlin/src/HAL/HAL_LPC1768/main.cpp

@ -48,9 +48,9 @@ void SysTick_Callback() {
disk_timerproc(); disk_timerproc();
} }
void HAL_init() { void HAL_init(void) {
// Support the 4 LEDs some LPC176x boards have // Init LEDs
#if PIN_EXISTS(LED) #if PIN_EXISTS(LED)
SET_DIR_OUTPUT(LED_PIN); SET_DIR_OUTPUT(LED_PIN);
WRITE_PIN_CLR(LED_PIN); WRITE_PIN_CLR(LED_PIN);
@ -74,6 +74,20 @@ void HAL_init() {
} }
#endif #endif
// Init Servo Pins
#if PIN_EXISTS(SERVO0)
OUT_WRITE(SERVO0_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO1)
OUT_WRITE(SERVO1_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO2)
OUT_WRITE(SERVO2_PIN, LOW);
#endif
#if PIN_EXISTS(SERVO3)
OUT_WRITE(SERVO3_PIN, LOW);
#endif
//debug_frmwrk_init(); //debug_frmwrk_init();
//_DBG("\n\nDebug running\n"); //_DBG("\n\nDebug running\n");
// Initialise the SD card chip select pins as soon as possible // Initialise the SD card chip select pins as soon as possible

1
Marlin/src/HAL/HAL_STM32/HAL.h

@ -151,7 +151,6 @@ extern uint16_t HAL_adc_result;
#define __bss_end __bss_end__ #define __bss_end __bss_end__
// Enable hooks into setup for HAL // Enable hooks into setup for HAL
#define HAL_INIT 1
void HAL_init(void); void HAL_init(void);
/** clear reset reason */ /** clear reset reason */

5
Marlin/src/HAL/HAL_STM32F1/HAL.h

@ -117,9 +117,8 @@
#define NUM_SERIAL 1 #define NUM_SERIAL 1
#endif #endif
// Use HAL_init() to set interrupt grouping. // Set interrupt grouping for this MCU
#define HAL_INIT void HAL_init(void);
void HAL_init();
/** /**
* TODO: review this to return 1 for pins that are not analog input * TODO: review this to return 1 for pins that are not analog input

2
Marlin/src/HAL/HAL_STM32F4/HAL.h

@ -158,6 +158,8 @@ extern uint16_t HAL_adc_result;
// Memory related // Memory related
#define __bss_end __bss_end__ #define __bss_end __bss_end__
inline void HAL_init(void) { }
/** clear reset reason */ /** clear reset reason */
void HAL_clear_reset_source (void); void HAL_clear_reset_source (void);

2
Marlin/src/HAL/HAL_STM32F7/HAL.h

@ -145,6 +145,8 @@ extern uint16_t HAL_adc_result;
// Memory related // Memory related
#define __bss_end __bss_end__ #define __bss_end __bss_end__
inline void HAL_init(void) { }
/** clear reset reason */ /** clear reset reason */
void HAL_clear_reset_source (void); void HAL_clear_reset_source (void);

2
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h

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

2
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h

@ -97,6 +97,8 @@ typedef int8_t pin_t;
#undef pgm_read_word #undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr))) #define pgm_read_word(addr) (*((uint16_t*)(addr)))
inline void HAL_init(void) { }
/** clear reset reason */ /** clear reset reason */
void HAL_clear_reset_source(void); void HAL_clear_reset_source(void);

2
Marlin/src/Marlin.cpp

@ -822,9 +822,7 @@ void stop() {
*/ */
void setup() { void setup() {
#ifdef HAL_INIT
HAL_init(); HAL_init();
#endif
#if HAS_DRIVER(L6470) #if HAS_DRIVER(L6470)
L6470.init(); // setup SPI and then init chips L6470.init(); // setup SPI and then init chips

Loading…
Cancel
Save