|
@@ -154,18 +154,18 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
|
154
|
154
|
const char* _label_pstr = PSTR(label); \
|
155
|
155
|
if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
|
156
|
156
|
lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, _label_pstr , ## args ); \
|
157
|
|
- }else{\
|
|
157
|
+ }else{\
|
158
|
158
|
lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
|
159
|
|
- }\
|
160
|
|
- }\
|
|
159
|
+ }\
|
|
160
|
+ }\
|
161
|
161
|
if (wasClicked && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\
|
162
|
162
|
lcd_quick_feedback(); \
|
163
|
|
- encoderRateMultiplierEnabled = true; \
|
164
|
|
- lastEncoderMovementMillis = 0; \
|
|
163
|
+ encoderRateMultiplierEnabled = true; \
|
|
164
|
+ lastEncoderMovementMillis = 0; \
|
165
|
165
|
menu_action_ ## type ( args ); \
|
166
|
166
|
return;\
|
167
|
|
- }\
|
168
|
|
- }\
|
|
167
|
+ }\
|
|
168
|
+ }\
|
169
|
169
|
_menuItemNr++;\
|
170
|
170
|
} while(0)
|
171
|
171
|
#endif
|
|
@@ -460,20 +460,20 @@ static void lcd_tune_menu()
|
460
|
460
|
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
|
461
|
461
|
#endif
|
462
|
462
|
#if TEMP_SENSOR_1 != 0
|
463
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
|
|
463
|
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
|
464
|
464
|
#endif
|
465
|
465
|
#if TEMP_SENSOR_2 != 0
|
466
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
|
|
466
|
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
|
467
|
467
|
#endif
|
468
|
468
|
#if TEMP_SENSOR_3 != 0
|
469
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
|
|
469
|
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
|
470
|
470
|
#endif
|
471
|
471
|
|
472
|
472
|
|
473
|
473
|
#if TEMP_SENSOR_BED != 0
|
474
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
|
|
474
|
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
|
475
|
475
|
#endif
|
476
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
|
|
476
|
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
|
477
|
477
|
MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
|
478
|
478
|
MENU_ITEM_EDIT(int3, MSG_FLOW " 0", &extruder_multiply[0], 10, 999);
|
479
|
479
|
#if TEMP_SENSOR_1 != 0
|
|
@@ -650,7 +650,7 @@ static void lcd_preheat_abs_menu()
|
650
|
650
|
MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
|
651
|
651
|
MENU_ITEM(function, MSG_PREHEAT_ABS_N "1", lcd_preheat_abs0);
|
652
|
652
|
#if TEMP_SENSOR_1 != 0 //2 extruder preheat
|
653
|
|
- MENU_ITEM(function, MSG_PREHEAT_ABS_N "2", lcd_preheat_abs1);
|
|
653
|
+ MENU_ITEM(function, MSG_PREHEAT_ABS_N "2", lcd_preheat_abs1);
|
654
|
654
|
#endif //2 extruder preheat
|
655
|
655
|
#if TEMP_SENSOR_2 != 0 //3 extruder preheat
|
656
|
656
|
MENU_ITEM(function, MSG_PREHEAT_ABS_N "3", lcd_preheat_abs2);
|
|
@@ -995,16 +995,16 @@ static void lcd_control_volumetric_menu()
|
995
|
995
|
MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
|
996
|
996
|
|
997
|
997
|
if (volumetric_enabled) {
|
998
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_0, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
|
999
|
|
-#if EXTRUDERS > 1
|
1000
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_1, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
|
1001
|
|
-#if EXTRUDERS > 2
|
1002
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_2, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
|
1003
|
|
-#if EXTRUDERS > 3
|
1004
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_3, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
|
1005
|
|
-#endif //EXTRUDERS > 3
|
1006
|
|
-#endif //EXTRUDERS > 2
|
1007
|
|
-#endif //EXTRUDERS > 1
|
|
998
|
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_0, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
|
|
999
|
+ #if EXTRUDERS > 1
|
|
1000
|
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_1, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
|
|
1001
|
+ #if EXTRUDERS > 2
|
|
1002
|
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_2, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
|
|
1003
|
+ #if EXTRUDERS > 3
|
|
1004
|
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_3, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
|
|
1005
|
+ #endif //EXTRUDERS > 3
|
|
1006
|
+ #endif //EXTRUDERS > 2
|
|
1007
|
+ #endif //EXTRUDERS > 1
|
1008
|
1008
|
}
|
1009
|
1009
|
|
1010
|
1010
|
END_MENU();
|
|
@@ -1356,47 +1356,47 @@ void lcd_update()
|
1356
|
1356
|
#endif
|
1357
|
1357
|
if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
|
1358
|
1358
|
{
|
1359
|
|
- int32_t encoderMultiplier = 1;
|
|
1359
|
+ int32_t encoderMultiplier = 1;
|
1360
|
1360
|
|
1361
|
1361
|
#ifdef ENCODER_RATE_MULTIPLIER
|
1362
|
|
- if (encoderRateMultiplierEnabled)
|
1363
|
|
- {
|
1364
|
|
- int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
|
1365
|
|
-
|
1366
|
|
- if (lastEncoderMovementMillis != 0)
|
1367
|
|
- {
|
1368
|
|
- // Note that the rate is always calculated between to passes through the
|
1369
|
|
- // loop and that the abs of the encoderDiff value is tracked.
|
1370
|
|
- float encoderStepRate =
|
1371
|
|
- (float)(encoderMovementSteps) / ((float)(millis() - lastEncoderMovementMillis)) * 1000.0;
|
1372
|
|
-
|
1373
|
|
- if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)
|
1374
|
|
- {
|
1375
|
|
- encoderMultiplier = 100;
|
1376
|
|
- }
|
1377
|
|
- else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)
|
1378
|
|
- {
|
1379
|
|
- encoderMultiplier = 10;
|
1380
|
|
- }
|
|
1362
|
+ if (encoderRateMultiplierEnabled)
|
|
1363
|
+ {
|
|
1364
|
+ int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
|
|
1365
|
+
|
|
1366
|
+ if (lastEncoderMovementMillis != 0)
|
|
1367
|
+ {
|
|
1368
|
+ // Note that the rate is always calculated between to passes through the
|
|
1369
|
+ // loop and that the abs of the encoderDiff value is tracked.
|
|
1370
|
+ float encoderStepRate =
|
|
1371
|
+ (float)(encoderMovementSteps) / ((float)(millis() - lastEncoderMovementMillis)) * 1000.0;
|
|
1372
|
+
|
|
1373
|
+ if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)
|
|
1374
|
+ {
|
|
1375
|
+ encoderMultiplier = 100;
|
|
1376
|
+ }
|
|
1377
|
+ else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)
|
|
1378
|
+ {
|
|
1379
|
+ encoderMultiplier = 10;
|
|
1380
|
+ }
|
1381
|
1381
|
|
1382
|
1382
|
#ifdef ENCODER_RATE_MULTIPLIER_DEBUG
|
1383
|
|
- SERIAL_ECHO_START;
|
1384
|
|
- SERIAL_ECHO("Enc Step Rate: ");
|
1385
|
|
- SERIAL_ECHO(encoderStepRate);
|
1386
|
|
- SERIAL_ECHO(" Multiplier: ");
|
1387
|
|
- SERIAL_ECHO(encoderMultiplier);
|
1388
|
|
- SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: ");
|
1389
|
|
- SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
|
1390
|
|
- SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: ");
|
1391
|
|
- SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
|
|
1383
|
+ SERIAL_ECHO_START;
|
|
1384
|
+ SERIAL_ECHO("Enc Step Rate: ");
|
|
1385
|
+ SERIAL_ECHO(encoderStepRate);
|
|
1386
|
+ SERIAL_ECHO(" Multiplier: ");
|
|
1387
|
+ SERIAL_ECHO(encoderMultiplier);
|
|
1388
|
+ SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: ");
|
|
1389
|
+ SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
|
|
1390
|
+ SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: ");
|
|
1391
|
+ SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
|
1392
|
1392
|
#endif
|
1393
|
|
- }
|
|
1393
|
+ }
|
1394
|
1394
|
|
1395
|
|
- lastEncoderMovementMillis = millis();
|
1396
|
|
- }
|
|
1395
|
+ lastEncoderMovementMillis = millis();
|
|
1396
|
+ }
|
1397
|
1397
|
#endif
|
1398
|
1398
|
lcdDrawUpdate = 1;
|
1399
|
|
- encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
|
|
1399
|
+ encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
|
1400
|
1400
|
encoderDiff = 0;
|
1401
|
1401
|
timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
1402
|
1402
|
}
|