Raster is now tested and working great

parent 6ecfabca
......@@ -218,7 +218,8 @@ void laser_fire(float intensity = 100.0){
// In the case that the laserdriver need at least a certain level "LASER_REMAP_INTENSITY"
// to give anything, the intensity can be remapped to start at "LASER_REMAP_INTENSITY"
// At least some CO2-drivers need it, not sure about laserdiode drivers.
#if(ENABLED(LASER_REMAP_INTENSITY))
#if(ENABLED(LASER_REMAP_INTENSITY) && ENABLED(LASER_PULSE_METHOD))
#if LASER_REMAP_INTENSITY != 0
float OldRange, NewRange;
OldRange = (255.0 - 0.0);
......
......@@ -899,7 +899,21 @@ float junction_deviation = 0.1;
block->steps_l = labs(block->millimeters*laser.ppm);
if (laser.mode == RASTER) {
for (int i = 0; i < LASER_MAX_RASTER_LINE; i++) {
#if (!ENABLED(LASER_PULSE_METHOD))
float OldRange, NewRange;
float NewValue;
OldRange = (255.0 - 0.0);
NewRange = (laser.rasterlaserpower - LASER_REMAP_INTENSITY);
NewValue = (float)(((((float)laser.raster_data[i] - 0) * NewRange) / OldRange) + LASER_REMAP_INTENSITY);
//If less than 7%, turn off the laser tube.
if(NewValue == LASER_REMAP_INTENSITY)
NewValue = 0;
block->laser_raster_data[i] = NewValue;
#else
block->laser_raster_data[i] = laser.raster_data[i];
#endif
}
}
} else {
......
......@@ -1829,6 +1829,9 @@
#endif
#if ENABLED(LASER)
#if (!ENABLED(LASER_REMAP_INTENSITY) && ENABLED(LASER_RASTER))
#error DEPENDENCY ERROR: You have to set LASER_REMAP_INTENSITY with LASER_RASTER enabled
#endif
#if (!ENABLED(LASER_CONTROL) || ((LASER_CONTROL > 0) && (LASER_CONTROL < 2)))
#error DEPENDENCY ERROR: You have to set LASER_CONTROL to 1 or 2
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment