Improve STM32F4 Flash Behavior (#17946)

This commit is contained in:
Jason Smith
2020-05-10 23:10:20 -07:00
committed by GitHub
parent 9d545f1231
commit 25aade1cf1
4 changed files with 87 additions and 13 deletions

View File

@@ -27,15 +27,27 @@
#include "../../core/millis_t.h"
// Inherit and expand on the official library
class libServo : public Servo {
class libServo {
public:
libServo();
int8_t attach(const int pin);
int8_t attach(const int pin = 0); // pin == 0 uses value from previous call
int8_t attach(const int pin, const int min, const int max);
void detach() { stm32_servo.detach(); }
int read() { return stm32_servo.read(); }
void move(const int value);
void pause();
void resume();
static void pause_all_servos();
static void resume_all_servos();
private:
typedef Servo super;
Servo stm32_servo;
int servo_pin = 0;
millis_t delay = 0;
bool was_attached_before_pause;
int value_before_pause;
};