mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-31 10:01:48 +02:00
Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings
This commit is contained in:
@@ -86,3 +86,8 @@ probe:
|
|||||||
PWM:
|
PWM:
|
||||||
output_pin: gpio.2
|
output_pin: gpio.2
|
||||||
enable_pin: gpio.22
|
enable_pin: gpio.22
|
||||||
|
pwm_off: 0.0
|
||||||
|
pwm_min: 0.0
|
||||||
|
pwm_max: 100.0
|
||||||
|
min_rpm: 0
|
||||||
|
max_rpm: 1000
|
||||||
|
@@ -505,7 +505,7 @@ size_t MachineConfig::readFile(const char* filename, char*& buffer) {
|
|||||||
file.close();
|
file.close();
|
||||||
buffer[filesize] = 0;
|
buffer[filesize] = 0;
|
||||||
|
|
||||||
log_debug("Read config file:\r\n" << buffer);
|
log_debug("Read config file:" << buffer);
|
||||||
|
|
||||||
if (pos != filesize) {
|
if (pos != filesize) {
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
@@ -86,3 +86,8 @@ probe:
|
|||||||
pwm:
|
pwm:
|
||||||
output_pin: gpio.2
|
output_pin: gpio.2
|
||||||
enable_pin: gpio.22
|
enable_pin: gpio.22
|
||||||
|
pwm_off: 0.0
|
||||||
|
pwm_min: 0.0
|
||||||
|
pwm_max: 100.0
|
||||||
|
min_rpm: 0
|
||||||
|
max_rpm: 1000
|
||||||
|
@@ -54,9 +54,9 @@ namespace Spindles {
|
|||||||
handler.item("max_rpm", _max_rpm);
|
handler.item("max_rpm", _max_rpm);
|
||||||
|
|
||||||
handler.item("pwm_freq", _pwm_freq);
|
handler.item("pwm_freq", _pwm_freq);
|
||||||
handler.item("pwm_off", _pwm_off_setting);
|
handler.item("pwm_off", _pwm_off_setting, 0.0, 100.0);
|
||||||
handler.item("pwm_min", _pwm_min_setting);
|
handler.item("pwm_min", _pwm_min_setting, 0.0, 100.0);
|
||||||
handler.item("pwm_max", _pwm_max_setting);
|
handler.item("pwm_max", _pwm_max_setting, 0.0, 100.0);
|
||||||
handler.item("invert_pwm", _invert_pwm);
|
handler.item("invert_pwm", _invert_pwm);
|
||||||
handler.item("output_pin", _output_pin);
|
handler.item("output_pin", _output_pin);
|
||||||
handler.item("enable_pin", _enable_pin);
|
handler.item("enable_pin", _enable_pin);
|
||||||
@@ -72,25 +72,25 @@ namespace Spindles {
|
|||||||
virtual ~PWM() {}
|
virtual ~PWM() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint32_t _pwm_off_setting; // do we need these 3?
|
float _pwm_off_setting = 0; // do we need these 3?
|
||||||
uint32_t _pwm_min_setting;
|
float _pwm_min_setting = 0;
|
||||||
uint32_t _pwm_max_setting;
|
float _pwm_max_setting = 0;
|
||||||
|
|
||||||
int32_t _current_pwm_duty;
|
int32_t _current_pwm_duty;
|
||||||
uint32_t _min_rpm;
|
uint32_t _min_rpm = 0;
|
||||||
uint32_t _max_rpm;
|
uint32_t _max_rpm = 1000;
|
||||||
uint32_t _pwm_off;
|
uint32_t _pwm_off; // calculated at init
|
||||||
uint32_t _pwm_min;
|
uint32_t _pwm_min; // calculated at init
|
||||||
uint32_t _pwm_max;
|
uint32_t _pwm_max; // calculated at init
|
||||||
Pin _output_pin;
|
Pin _output_pin;
|
||||||
Pin _enable_pin;
|
Pin _enable_pin;
|
||||||
Pin _direction_pin;
|
Pin _direction_pin;
|
||||||
uint8_t _pwm_chan_num;
|
uint8_t _pwm_chan_num;
|
||||||
uint32_t _pwm_freq = 5000;
|
uint32_t _pwm_freq = 5000;
|
||||||
uint32_t _pwm_period; // how many counts in 1 period
|
uint32_t _pwm_period; // how many counts in 1 period
|
||||||
uint8_t _pwm_precision;
|
uint8_t _pwm_precision; // auto calculated
|
||||||
bool _off_with_zero_speed;
|
bool _off_with_zero_speed = false;
|
||||||
bool _invert_pwm;
|
bool _invert_pwm = false;
|
||||||
|
|
||||||
virtual void set_direction(bool Clockwise);
|
virtual void set_direction(bool Clockwise);
|
||||||
virtual void set_output(uint32_t duty);
|
virtual void set_output(uint32_t duty);
|
||||||
|
Reference in New Issue
Block a user