Disable PWM output while updating NeoPixels.
This commit is contained in:
parent
6071a0835a
commit
d765c452e4
4 changed files with 10 additions and 9 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "Servo.h"
|
||||
#include "watchdog.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
|
|
@ -110,6 +111,9 @@
|
|||
typedef int16_t pin_t;
|
||||
|
||||
#define HAL_SERVO_LIB libServo
|
||||
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
|
||||
#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
|
||||
#define HAS_PAUSE_SERVO_OUTPUT HAS_SERVOS
|
||||
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
|
|
|
|||
|
|
@ -28,15 +28,6 @@
|
|||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#if HAS_SERVOS
|
||||
#include "Servo.h"
|
||||
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
|
||||
#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
|
||||
#else
|
||||
#define PAUSE_SERVO_OUTPUT()
|
||||
#define RESUME_SERVO_OUTPUT()
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The STM32 HAL supports chips that deal with "pages" and some with "sectors" and some that
|
||||
* even have multiple "banks" of flash.
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ public:
|
|||
}
|
||||
|
||||
static inline void show() {
|
||||
// Some platforms cannot maintain PWM output when NeoPixel disables interrupts for long durations.
|
||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
|
||||
adaneo1.show();
|
||||
#if PIN_EXISTS(NEOPIXEL2)
|
||||
#if CONJOINED_NEOPIXEL
|
||||
|
|
@ -115,6 +117,7 @@ public:
|
|||
adaneo1.setPin(NEOPIXEL_PIN);
|
||||
#endif
|
||||
#endif
|
||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
|
|
@ -1999,6 +1999,9 @@
|
|||
#if NUM_SERVOS > 0
|
||||
#define HAS_SERVOS 1
|
||||
#endif
|
||||
#if !HAS_SERVOS || !defined(HAS_PAUSE_SERVO_OUTPUT)
|
||||
#define HAS_PAUSE_SERVO_OUTPUT 0
|
||||
#endif
|
||||
|
||||
// Sensors
|
||||
#if PIN_EXISTS(FILWIDTH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue