void Endstops::on_get_public_data(void* argument){
PublicDataRequest* pdr = static_cast<PublicDataRequest*>(argument);
- static float return_data[3];
if(!pdr->starts_with(endstops_checksum)) return;
if(pdr->second_element_is(trim_checksum)) {
- return_data[0]= this->trim_mm[0];
- return_data[1]= this->trim_mm[1];
- return_data[2]= this->trim_mm[2];
-
- pdr->set_data_ptr(&return_data);
+ pdr->set_data_ptr(&this->trim_mm);
pdr->set_taken();
}else if(pdr->second_element_is(home_offset_checksum)) {
- return_data[0]= this->home_offset[0];
- return_data[1]= this->home_offset[1];
- return_data[2]= this->home_offset[2];
-
- pdr->set_data_ptr(&return_data);
+ pdr->set_data_ptr(&this->home_offset);
pdr->set_taken();
}
}
void set_proportional_power();
mbed::PwmOut* laser_pin; // PWM output to regulate the laser power
- bool laser_on; // Laser status
- bool laser_inverting; // stores whether the pwm period should be inverted
+ struct {
+ bool laser_on:1; // Laser status
+ bool laser_inverting:1; // stores whether the pwm period should be inverted
+ };
float laser_max_power; // maximum allowed laser power to be output on the pwm pin
float laser_tickle_power; // value used to tickle the laser on moves
};
Pwm heater_pin;
- bool use_bangbang;
- bool waiting;
- bool min_temp_violated;
- bool link_to_tool;
- bool active;
+ struct {
+ bool use_bangbang:1;
+ bool waiting:1;
+ bool min_temp_violated:1;
+ bool link_to_tool:1;
+ bool active:1;
+ };
uint16_t set_m_code;
uint16_t set_and_wait_m_code;
// we are not managing this tool so do not answer
if(!managed) return;
- // this must be static as it will be accessed long after we have returned
- static uint16_t tool_name;
- tool_name= this->current_tool_name;
-
- pdr->set_data_ptr(&tool_name);
+ pdr->set_data_ptr(&this->current_tool_name);
pdr->set_taken();
}
stream->printf("break - break into debugger\r\n");
stream->printf("config-get [<configuration_source>] <configuration_setting>\r\n");
stream->printf("config-set [<configuration_source>] <configuration_setting> <value>\r\n");
- stream->printf("config-load [<file_name>]\r\n");
stream->printf("get temp [bed|hotend]\r\n");
stream->printf("set_temp bed|hotend 185\r\n");
stream->printf("get pos\r\n");