Improved support for panelolu2 encoder and buzzer
I added #define for LCD_FEEDBACK_FREQUENCY_HZ and LCD_FEEDBACK_FREQUENCY_DURATION_MS which is used to alter the default buzzer sound. When selecting Panelolu2 in configuration.h: - it automatically sets the correct ENCODER_PULSES_PER_STEP and ENCODER_STEPS_PER_MENU_ITEM. - if LCD_USE_I2C_BUZZER is defined it will also set the default LCD_FEEDBACK_FREQUENCY_HZ and LCD_FEEDBACK_FREQUENCY_DURATION_MS When selecting the sanguinololu 1284p the following is true: - its now enables LARGE_FLASH - It enables the gcode M300 when the panelolu2 LCD_USE_I2C_BUZZER is defined
This commit is contained in:
@ -2466,7 +2466,7 @@ void process_commands()
|
||||
break;
|
||||
#endif // NUM_SERVOS > 0
|
||||
|
||||
#if LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) )
|
||||
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
|
||||
case 300: // M300
|
||||
{
|
||||
int beepS = code_seen('S') ? code_value() : 110;
|
||||
@ -2478,7 +2478,9 @@ void process_commands()
|
||||
delay(beepP);
|
||||
noTone(BEEPER);
|
||||
#elif defined(ULTRALCD)
|
||||
lcd_buzz(beepS, beepP);
|
||||
lcd_buzz(beepS, beepP);
|
||||
#elif defined(LCD_USE_I2C_BUZZER)
|
||||
lcd_buzz(beepP, beepS);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -2736,7 +2738,11 @@ void process_commands()
|
||||
WRITE(BEEPER,LOW);
|
||||
delay(3);
|
||||
#else
|
||||
lcd_buzz(1000/6,100);
|
||||
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
|
||||
lcd_buzz(1000/6,100);
|
||||
#else
|
||||
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS,LCD_FEEDBACK_FREQUENCY_HZ);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user