🩹 Daily cleanup Nov 18

This commit is contained in:
Scott Lahteine 2024-11-18 19:16:22 -06:00
parent bf98c16a00
commit fa55caed1f
6 changed files with 51 additions and 52 deletions

View file

@ -291,7 +291,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
uint32_t *p1 = (uint32_t*)addrflash; uint32_t *p1 = (uint32_t*)addrflash;
uint32_t *p2 = (uint32_t*)data; uint32_t *p2 = (uint32_t*)data;
int count = 0; int count = 0;
for (i =0; i<PageSize >> 2; i++) { for (i = 0; i < PageSize >> 2; i++) {
if (p1[i] != p2[i]) { if (p1[i] != p2[i]) {
uint32_t delta = p1[i] ^ p2[i]; uint32_t delta = p1[i] ^ p2[i];
while (delta) { while (delta) {

View file

@ -53,7 +53,7 @@
* 41 - Counter-Clockwise M4 * 41 - Counter-Clockwise M4
* 50 - Clockwise M5 * 50 - Clockwise M5
* 51 - Counter-Clockwise M5 * 51 - Counter-Clockwise M5
**/ */
void GcodeSuite::G35() { void GcodeSuite::G35() {
DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING)); DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING));

View file

@ -43,40 +43,40 @@
* P : Flag to put the probe at the given point * P : Flag to put the probe at the given point
*/ */
void GcodeSuite::G42() { void GcodeSuite::G42() {
if (MOTION_CONDITIONS) { if (!MOTION_CONDITIONS) return;
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;
const bool hasJ = parser.seenval('J');
const int8_t iy = hasJ ? parser.value_int() : 0;
if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { const bool hasI = parser.seenval('I');
SERIAL_ECHOLNPGM(STR_ERR_MESH_XY); const int8_t ix = hasI ? parser.value_int() : 0;
return; const bool hasJ = parser.seenval('J');
} const int8_t iy = hasJ ? parser.value_int() : 0;
// Move to current_position, as modified by I, J, P parameters if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
destination = current_position; SERIAL_ECHOLNPGM(STR_ERR_MESH_XY);
return;
if (hasI) destination.x = bedlevel.get_mesh_x(ix);
if (hasJ) destination.y = bedlevel.get_mesh_y(iy);
#if HAS_PROBE_XY_OFFSET
if (parser.seen_test('P')) {
if (hasI) destination.x -= probe.offset_xy.x;
if (hasJ) destination.y -= probe.offset_xy.y;
}
#endif
const feedRate_t fval = parser.linearval('F'),
fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
// SCARA kinematic has "safe" XY raw moves
#if IS_SCARA
prepare_internal_fast_move_to_destination(fr_mm_s);
#else
prepare_internal_move_to_destination(fr_mm_s);
#endif
} }
// Move to current_position, as modified by I, J, P parameters
destination = current_position;
if (hasI) destination.x = bedlevel.get_mesh_x(ix);
if (hasJ) destination.y = bedlevel.get_mesh_y(iy);
#if HAS_PROBE_XY_OFFSET
if (parser.seen_test('P')) {
if (hasI) destination.x -= probe.offset_xy.x;
if (hasJ) destination.y -= probe.offset_xy.y;
}
#endif
const feedRate_t fval = parser.linearval('F'),
fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
// SCARA kinematic has "safe" XY raw moves
#if IS_SCARA
prepare_internal_fast_move_to_destination(fr_mm_s);
#else
prepare_internal_move_to_destination(fr_mm_s);
#endif
} }
#endif // HAS_MESH #endif // HAS_MESH

View file

@ -109,7 +109,7 @@ void GcodeSuite::M115() {
SERIAL_ECHO(F("CEDE2A2F-")); SERIAL_ECHO(F("CEDE2A2F-"));
for (uint8_t i = 1; i <= 6; i++) { for (uint8_t i = 1; i <= 6; i++) {
print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444 print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
if (i <= 3) SERIAL_ECHO(C('-')); if (i <= 3) SERIAL_CHAR('-');
} }
#endif #endif
#endif #endif

View file

@ -45,25 +45,24 @@
* G5: Cubic B-spline * G5: Cubic B-spline
*/ */
void GcodeSuite::G5() { void GcodeSuite::G5() {
if (MOTION_CONDITIONS) { if (!MOTION_CONDITIONS) return;
#if ENABLED(CNC_WORKSPACE_PLANES) #if ENABLED(CNC_WORKSPACE_PLANES)
if (workspace_plane != PLANE_XY) { if (workspace_plane != PLANE_XY) {
SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE); SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
return; return;
} }
#endif #endif
get_destination_from_command(); get_destination_from_command();
const xy_pos_t offsets[2] = { const xy_pos_t offsets[2] = {
{ parser.linearval('I'), parser.linearval('J') }, { parser.linearval('I'), parser.linearval('J') },
{ parser.linearval('P'), parser.linearval('Q') } { parser.linearval('P'), parser.linearval('Q') }
}; };
cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder); cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
current_position = destination; current_position = destination;
}
} }
#endif // BEZIER_CURVE_SUPPORT #endif // BEZIER_CURVE_SUPPORT

View file

@ -44,9 +44,9 @@
// //
// Limit Switches // Limit Switches
// //
#define X_MIN_PIN 5 #define X_STOP_PIN 5
#define Y_MIN_PIN 2 #define Y_STOP_PIN 2
#define Z_MIN_PIN 6 #define Z_STOP_PIN 6
// //
// Steppers // Steppers