@@ -46,7 +46,7 @@ Nozzle nozzle;
46
46
* @param end xyz_pos_t defining the ending point
47
47
* @param strokes number of strokes to execute
48
48
*/
49
- void Nozzle::stroke (const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t & strokes) {
49
+ void Nozzle::stroke (const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t strokes) {
50
50
#if ENABLED(NOZZLE_CLEAN_GOBACK)
51
51
const xyz_pos_t oldpos = current_position;
52
52
#endif
@@ -87,7 +87,7 @@ Nozzle nozzle;
87
87
* @param strokes number of strokes to execute
88
88
* @param objects number of triangles to do
89
89
*/
90
- void Nozzle::zigzag (const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t & strokes, const uint8_t & objects) {
90
+ void Nozzle::zigzag (const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t strokes, const uint8_t objects) {
91
91
const xy_pos_t diff = end - start;
92
92
if (!diff.x || !diff.y ) return ;
93
93
@@ -135,7 +135,7 @@ Nozzle nozzle;
135
135
* @param strokes number of strokes to execute
136
136
* @param radius radius of circle
137
137
*/
138
- void Nozzle::circle (const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t & strokes, const_float_t radius) {
138
+ void Nozzle::circle (const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t strokes, const_float_t radius) {
139
139
if (strokes == 0 ) return ;
140
140
141
141
#if ENABLED(NOZZLE_CLEAN_GOBACK)
@@ -164,7 +164,7 @@ Nozzle nozzle;
164
164
* @param pattern one of the available patterns
165
165
* @param argument depends on the cleaning pattern
166
166
*/
167
- void Nozzle::clean (const uint8_t & pattern, const uint8_t & strokes, const_float_t radius, const uint8_t & objects, const uint8_t cleans) {
167
+ void Nozzle::clean (const uint8_t pattern, const uint8_t strokes, const_float_t radius, const uint8_t objects, const uint8_t cleans) {
168
168
xyz_pos_t start[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT;
169
169
#if ENABLED(NOZZLE_CLEAN_PATTERN_CIRCLE)
170
170
xyz_pos_t middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE;
@@ -230,10 +230,9 @@ Nozzle nozzle;
230
230
}
231
231
if (!TEST (cleans, Z_AXIS)) start[arrPos].z = end[arrPos].z = current_position.z ;
232
232
233
- switch (pattern) {
234
- default :
233
+ switch (pattern) { // no default clause as pattern is already validated
235
234
#if ENABLED(NOZZLE_CLEAN_PATTERN_LINE)
236
- case 0 : stroke (start[arrPos], end[arrPos], strokes);
235
+ case 0 : stroke (start[arrPos], end[arrPos], strokes); break ;
237
236
#endif
238
237
#if ENABLED(NOZZLE_CLEAN_PATTERN_ZIGZAG)
239
238
case 1 : zigzag (start[arrPos], end[arrPos], strokes, objects); break ;
0 commit comments