configtool: add FORCE_SOFTWARE_PWM to configtool
This commit is contained in:
parent
4882d19215
commit
fbe1af4013
|
|
@ -194,6 +194,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,14 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,14 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,14 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PIO1_0,THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,14 @@
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
|
|
||||||
self.nameValid = (name != "")
|
self.nameValid = (name != "")
|
||||||
self.maxPWMValid = (max_pwm != "")
|
self.maxPWMValid = (max_pwm != "")
|
||||||
|
self.pwmValid = (pwm != "")
|
||||||
|
|
||||||
sz = wx.BoxSizer(wx.VERTICAL)
|
sz = wx.BoxSizer(wx.VERTICAL)
|
||||||
gsz = wx.GridBagSizer()
|
gsz = wx.GridBagSizer()
|
||||||
|
|
@ -78,14 +79,24 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
|
|
||||||
gsz.Add(self.cbInv, pos = (3, 3))
|
gsz.Add(self.cbInv, pos = (3, 3))
|
||||||
|
|
||||||
self.cbPwm = wx.CheckBox(self, wx.ID_ANY, "PWM")
|
lsz = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.cbPwm.SetFont(font)
|
st = wx.StaticText(self, wx.ID_ANY, "PWM:", size = (60, -1),
|
||||||
self.cbPwm.SetValue(int(pwm) != 0)
|
style = wx.ALIGN_RIGHT)
|
||||||
self.cbPwm.SetToolTipString("Use Pulse Width Modulation in case the "
|
st.SetFont(font)
|
||||||
"choosen pin allows to do so.")
|
lsz.Add(st, 1, wx.TOP, offsetChLabel)
|
||||||
|
|
||||||
|
self.tcPwm = wx.TextCtrl(self, wx.ID_ANY, pwm, size=(60, -1))
|
||||||
|
self.tcPwm.SetFont(font)
|
||||||
|
self.tcPwm.Bind(wx.EVT_TEXT, self.onPWM)
|
||||||
|
lsz.Add(self.tcPwm)
|
||||||
|
self.tcPwm.SetToolTipString("Use Pulse Width Modulation. "
|
||||||
|
"Hardware PWM if available or "
|
||||||
|
"Software PWM. When FORCE_SOFTWARE_PWM "
|
||||||
|
"is set, always software PWM for 1 and "
|
||||||
|
"hardware PWM for >= 2.")
|
||||||
|
|
||||||
gsz.AddSpacer((50, 15), pos = (1, 2))
|
gsz.AddSpacer((50, 15), pos = (1, 2))
|
||||||
gsz.Add(self.cbPwm, pos = (1, 3))
|
gsz.Add(lsz, pos = (1, 3))
|
||||||
gsz.AddSpacer((20, 20), pos = (4, 4))
|
gsz.AddSpacer((20, 20), pos = (4, 4))
|
||||||
|
|
||||||
sz.Add(gsz)
|
sz.Add(gsz)
|
||||||
|
|
@ -156,8 +167,29 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
if evt is not None:
|
if evt is not None:
|
||||||
evt.Skip()
|
evt.Skip()
|
||||||
|
|
||||||
|
def onPWM(self, evt):
|
||||||
|
tc = evt.GetEventObject()
|
||||||
|
w = tc.GetValue().strip()
|
||||||
|
if w == "":
|
||||||
|
self.pwmValid = False
|
||||||
|
else:
|
||||||
|
if int(w) >= 0:
|
||||||
|
self.pwmValid = True
|
||||||
|
else:
|
||||||
|
self.pwmValid = False
|
||||||
|
|
||||||
|
if self.pwmValid:
|
||||||
|
tc.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
|
||||||
|
else:
|
||||||
|
tc.SetBackgroundColour("pink")
|
||||||
|
tc.Refresh()
|
||||||
|
|
||||||
|
self.checkDlgValidity()
|
||||||
|
if evt is not None:
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
def checkDlgValidity(self):
|
def checkDlgValidity(self):
|
||||||
if (self.nameValid and self.maxPWMValid):
|
if (self.nameValid and self.maxPWMValid and self.pwmValid):
|
||||||
self.bSave.Enable(True)
|
self.bSave.Enable(True)
|
||||||
else:
|
else:
|
||||||
self.bSave.Enable(False)
|
self.bSave.Enable(False)
|
||||||
|
|
@ -170,11 +202,8 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
invert = "1"
|
invert = "1"
|
||||||
else:
|
else:
|
||||||
invert = "0"
|
invert = "0"
|
||||||
|
|
||||||
if self.cbPwm.IsChecked():
|
pwm = self.tcPwm.GetValue()
|
||||||
pwm = "1"
|
|
||||||
else:
|
|
||||||
pwm = "0"
|
|
||||||
|
|
||||||
max_pwm = self.tcMaxPWM.GetValue()
|
max_pwm = self.tcMaxPWM.GetValue()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,14 @@
|
||||||
* *
|
* *
|
||||||
\***************************************************************************/
|
\***************************************************************************/
|
||||||
|
|
||||||
|
/** \def FORCE_SOFTWARE_PWM
|
||||||
|
Force software pwm when pwm is sets to 1.
|
||||||
|
|
||||||
|
Normally any pwm value >= 1 will set the pin to hardware pwm, if available.
|
||||||
|
When FORCE_SOFTWARE_PWM is defined, pwm = 1 is always set to software pwm.
|
||||||
|
*/
|
||||||
|
// #define FORCE_SOFTWARE_PWM
|
||||||
|
|
||||||
/** \def HEATER_PIN
|
/** \def HEATER_PIN
|
||||||
Heater pins a user should be able to choose from in configtool. All
|
Heater pins a user should be able to choose from in configtool. All
|
||||||
commented out.
|
commented out.
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,6 @@ class HeaterList(wx.ListCtrl):
|
||||||
else:
|
else:
|
||||||
return "False"
|
return "False"
|
||||||
elif col == 3:
|
elif col == 3:
|
||||||
if int(s[3]):
|
return s[3]
|
||||||
return "True"
|
|
||||||
else:
|
|
||||||
return "False"
|
|
||||||
elif col == 4:
|
elif col == 4:
|
||||||
return s[4]
|
return s[4]
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ class HeatersPage(wx.Panel, Page):
|
||||||
self.font = font
|
self.font = font
|
||||||
self.id = idPg
|
self.id = idPg
|
||||||
|
|
||||||
|
self.labels = {'FORCE_SOFTWARE_PWM':"Force software PWM"}
|
||||||
|
|
||||||
sz = wx.GridBagSizer()
|
sz = wx.GridBagSizer()
|
||||||
sz.AddSpacer((30, 30), pos = (0, 0))
|
sz.AddSpacer((30, 30), pos = (0, 0))
|
||||||
|
|
||||||
|
|
@ -24,6 +26,12 @@ class HeatersPage(wx.Panel, Page):
|
||||||
sz.Add(self.lb, pos = (1, 1))
|
sz.Add(self.lb, pos = (1, 1))
|
||||||
sz.AddSpacer((20, 20), pos = (1, 2))
|
sz.AddSpacer((20, 20), pos = (1, 2))
|
||||||
|
|
||||||
|
k = 'FORCE_SOFTWARE_PWM'
|
||||||
|
cb = self.addCheckBox(k, self.onCheckBox)
|
||||||
|
|
||||||
|
sz.Add(cb, pos = (2, 1))
|
||||||
|
sz.AddSpacer((20, 20), pos = (2, 2))
|
||||||
|
|
||||||
bsz = wx.BoxSizer(wx.VERTICAL)
|
bsz = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
|
||||||
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
|
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
|
||||||
|
|
|
||||||
4
heater.h
4
heater.h
|
|
@ -76,8 +76,12 @@ typedef enum {
|
||||||
HARDWARE_PWM = 2
|
HARDWARE_PWM = 2
|
||||||
} pwm_type_t;
|
} pwm_type_t;
|
||||||
|
|
||||||
|
#ifndef FORCE_SOFTWARE_PWM
|
||||||
// Force hardware PWM if available.
|
// Force hardware PWM if available.
|
||||||
#define HARDWARE_PWM_START SOFTWARE_PWM
|
#define HARDWARE_PWM_START SOFTWARE_PWM
|
||||||
|
#else
|
||||||
|
#define HARDWARE_PWM_START HARDWARE_PWM
|
||||||
|
#endif
|
||||||
|
|
||||||
void heater_init(void);
|
void heater_init(void);
|
||||||
void pid_init(void);
|
void pid_init(void);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue