Remove defines
This commit is contained in:
parent
ede3f34051
commit
008c6a2590
|
|
@ -74,24 +74,7 @@
|
||||||
* bit 6 = free
|
* bit 6 = free
|
||||||
* bit 7 = free
|
* bit 7 = free
|
||||||
*/
|
*/
|
||||||
#define AUTO_REPORT_ALL
|
#define AUTO_REPORT
|
||||||
|
|
||||||
#ifndef AUTO_REPORT_ALL
|
|
||||||
/**
|
|
||||||
* Auto-report temperatures with M155 S<seconds> [C1]
|
|
||||||
*/
|
|
||||||
#define AUTO_REPORT_TEMPERATURES
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-report fans with M155 S<seconds> C2
|
|
||||||
*/
|
|
||||||
#define AUTO_REPORT_FANS
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-report position with M155 S<seconds> C4
|
|
||||||
*/
|
|
||||||
#define AUTO_REPORT_POSITION
|
|
||||||
#endif //NOT AUTO_REPORT_ALL
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//=============================Mechanical Settings===========================
|
//=============================Mechanical Settings===========================
|
||||||
|
|
|
||||||
|
|
@ -403,24 +403,15 @@ class AutoReportFeatures {
|
||||||
} __attribute__((packed)) bits;
|
} __attribute__((packed)) bits;
|
||||||
uint8_t byte;
|
uint8_t byte;
|
||||||
} arFunctionsActive;
|
} arFunctionsActive;
|
||||||
uint8_t auto_report_period; //Also used for AUTO_REPORT_TEMPERATURES
|
uint8_t auto_report_period;
|
||||||
public:
|
public:
|
||||||
LongTimer auto_report_timer; //Also used for AUTO_REPORT_TEMPERATURES
|
LongTimer auto_report_timer;
|
||||||
AutoReportFeatures():auto_report_period(0){
|
AutoReportFeatures():auto_report_period(0){
|
||||||
#if defined(AUTO_REPORT_ALL)
|
#if defined(AUTO_REPORT)
|
||||||
arFunctionsActive.byte = 0xff;
|
arFunctionsActive.byte = 0xff;
|
||||||
#else
|
#else
|
||||||
arFunctionsActive.byte = 0;
|
arFunctionsActive.byte = 0;
|
||||||
# if defined(AUTO_REPORT_TEMPERATURES)
|
#endif //AUTO_REPORT
|
||||||
arFunctionsActive.bits.temp = 1;
|
|
||||||
# endif
|
|
||||||
# if defined(AUTO_REPORT_FANS)
|
|
||||||
arFunctionsActive.bits.fans = 1;
|
|
||||||
# endif
|
|
||||||
# if defined(AUTO_REPORT_POSITION)
|
|
||||||
arFunctionsActive.bits.pos = 1;
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Temp()const { return arFunctionsActive.bits.temp != 0; }
|
inline bool Temp()const { return arFunctionsActive.bits.temp != 0; }
|
||||||
|
|
@ -452,18 +443,6 @@ public:
|
||||||
|
|
||||||
AutoReportFeatures autoReportFeatures;
|
AutoReportFeatures autoReportFeatures;
|
||||||
|
|
||||||
//#if defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_ALL)
|
|
||||||
//static bool auto_report_temp_active = false;
|
|
||||||
//#endif //AUTO_REPORT_TEMPERATURES
|
|
||||||
|
|
||||||
//#if defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_ALL)
|
|
||||||
//static bool auto_report_fans_active = false;
|
|
||||||
//#endif //AUTO_REPORT_FANS
|
|
||||||
|
|
||||||
//#if defined(AUTO_REPORT_POSITION) || defined(AUTO_REPORT_ALL)
|
|
||||||
//static bool auto_report_position_active = false;
|
|
||||||
//#endif //AUTO_REPORT_POSITION
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//=============================Routines======================================
|
//=============================Routines======================================
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
@ -1800,28 +1779,25 @@ void host_keepalive() {
|
||||||
if (farm_mode) return;
|
if (farm_mode) return;
|
||||||
long ms = _millis();
|
long ms = _millis();
|
||||||
|
|
||||||
#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_POSITION)
|
#if defined(AUTO_REPORT)
|
||||||
if ( autoReportFeatures.TimerRunning())
|
|
||||||
{
|
{
|
||||||
if (autoReportFeatures.TimerExpired())
|
if (autoReportFeatures.TimerExpired())
|
||||||
{
|
{
|
||||||
if(autoReportFeatures.Temp()){
|
if(autoReportFeatures.Temp()){
|
||||||
gcode_M105(active_extruder);
|
gcode_M105(active_extruder);
|
||||||
}
|
}
|
||||||
#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_FANS) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
||||||
if(autoReportFeatures.Fans()){
|
|
||||||
gcode_M123();
|
|
||||||
}
|
|
||||||
#endif //AUTO_REPORT_ALL or AUTO_REPORT_FANS and (FANCHECK and TACH_0 or TACH_1)
|
|
||||||
#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_POSITION)
|
|
||||||
if(autoReportFeatures.Pos()){
|
if(autoReportFeatures.Pos()){
|
||||||
gcode_M114();
|
gcode_M114();
|
||||||
}
|
}
|
||||||
#endif //AUTO_REPORT_POSITION or AUTO_REPORT_FANS or AUTO_REPORT_POSITION
|
#if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
||||||
autoReportFeatures.TimerStart();
|
if(autoReportFeatures.Fans()){
|
||||||
|
gcode_M123();
|
||||||
|
}
|
||||||
|
#endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1)
|
||||||
|
autoReportFeatures.TimerStart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //AUTO_REPORT_ALL
|
#endif //AUTO_REPORT
|
||||||
|
|
||||||
|
|
||||||
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
||||||
|
|
@ -3606,14 +3582,14 @@ static void cap_line(const char* name, bool ena = false) {
|
||||||
static void extended_capabilities_report()
|
static void extended_capabilities_report()
|
||||||
{
|
{
|
||||||
// AUTOREPORT_TEMP (M155)
|
// AUTOREPORT_TEMP (M155)
|
||||||
cap_line(PSTR("AUTOREPORT_TEMP"), (ENABLED(AUTO_REPORT_TEMPERATURES)) || ENABLED(AUTO_REPORT_ALL));
|
cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT));
|
||||||
#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
||||||
// AUTOREPORT_FANS (M123)
|
// AUTOREPORT_FANS (M123)
|
||||||
cap_line(PSTR("AUTOREPORT_FANS"), (ENABLED(AUTO_REPORT_FANS) || ENABLED(AUTO_REPORT_ALL)));
|
cap_line(PSTR("AUTOREPORT_FANS"), ENABLED(AUTO_REPORT));
|
||||||
#endif //FANCHECK and TACH_0 or TACH_1
|
#endif //FANCHECK and TACH_0 or TACH_1
|
||||||
// AUTOREPORT_POSITION (M114)
|
// AUTOREPORT_POSITION (M114)
|
||||||
cap_line(PSTR("AUTOREPORT_POSITION"), (ENABLED(AUTO_REPORT_POSITION) || ENABLED(AUTO_REPORT_ALL)));
|
cap_line(PSTR("AUTOREPORT_POSITION"), ENABLED(AUTO_REPORT));
|
||||||
//@todo
|
//@todo Update RepRap cap
|
||||||
}
|
}
|
||||||
#endif //EXTENDED_CAPABILITIES_REPORT
|
#endif //EXTENDED_CAPABILITIES_REPORT
|
||||||
|
|
||||||
|
|
@ -6504,7 +6480,7 @@ Sigma_Exit:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_POSITION)
|
#if defined(AUTO_REPORT)
|
||||||
/*!
|
/*!
|
||||||
### M155 - Automatically send status <a href="https://reprap.org/wiki/G-code#M155:_Automatically_send_temperatures">M155: Automatically send temperatures</a>
|
### M155 - Automatically send status <a href="https://reprap.org/wiki/G-code#M155:_Automatically_send_temperatures">M155: Automatically send temperatures</a>
|
||||||
#### Usage
|
#### Usage
|
||||||
|
|
@ -6535,11 +6511,11 @@ Sigma_Exit:
|
||||||
if (code_seen('C')){
|
if (code_seen('C')){
|
||||||
autoReportFeatures.SetMask(code_value());
|
autoReportFeatures.SetMask(code_value());
|
||||||
} else{
|
} else{
|
||||||
autoReportFeatures.SetMask(1); //Backwards compability to host systems like Octoprint to send only temp if paramerter `C`isn't used
|
autoReportFeatures.SetMask(1); //Backwards compability to host systems like Octoprint to send only temp if paramerter `C`isn't used.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif //AUTO_REPORT_ALL or AUTO_REPORT_TEMPERATURES or AUTO_REPORT_FANS or AUTO_REPORT_POSITION
|
#endif //AUTO_REPORT
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
### M109 - Wait for extruder temperature <a href="https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait">M109: Set Extruder Temperature and Wait</a>
|
### M109 - Wait for extruder temperature <a href="https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait">M109: Set Extruder Temperature and Wait</a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue