Skip to content

Commit

Permalink
* new submenu Maintenance -> Preferences
Browse files Browse the repository at this point in the history
* adjustable click sound
  • Loading branch information
TinkerGnome committed Jul 1, 2015
1 parent e2f5a12 commit a73822c
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 450 deletions.
21 changes: 13 additions & 8 deletions Marlin/UltiLCD2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void lcd_init()
}
lcd_material_read_current_material();

glow_millis = millis() + 600;
glow_millis = millis() + 750;
led_glow = led_glow_dir = 0;

// initialize menu stack and show start animation
Expand Down Expand Up @@ -151,14 +151,17 @@ void lcd_menu_startup()
{
lcd_lib_encoder_pos = ENCODER_NO_SELECTION;

if (!lcd_lib_update_ready())
led_glow = 0;

LED_GLOW();
lcd_lib_clear();

lcd_lib_draw_gfx(0, 22, ultimakerTextGfx);
lcd_lib_draw_string_centerP(BOTTOM_MENU_YPOS, PSTR(STRING_CONFIG_H_AUTHOR));

if (led_glow < 84)
if ((led_glow > 0) && (led_glow < 84))
{
lcd_lib_draw_gfx(0, 22, ultimakerTextGfx);
for(uint8_t n=0;n<10;n++)
{
if (led_glow*2 >= n + 20)
Expand All @@ -175,12 +178,14 @@ void lcd_menu_startup()
//lcd_lib_clear_gfx(0, 22, ultimakerTextGfx);
lcd_lib_draw_gfx(0, 22, ultimakerTextGfx);
*/
}else{
//led_glow--;
//lcd_lib_draw_gfx(80, 0, ultimakerRobotGfx);
//lcd_lib_clear_gfx(0, 22, ultimakerTextOutlineGfx);
lcd_lib_draw_gfx(0, 22, ultimakerTextGfx);
}
// else
// {
// //led_glow--;
// //lcd_lib_draw_gfx(80, 0, ultimakerRobotGfx);
// //lcd_lib_clear_gfx(0, 22, ultimakerTextOutlineGfx);
// lcd_lib_draw_gfx(0, 22, ultimakerTextGfx);
// }
lcd_lib_update_screen();

if (led_mode == LED_MODE_ALWAYS_ON)
Expand Down
5 changes: 4 additions & 1 deletion Marlin/UltiLCD2_hi_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ void lcd_scroll_menu(const char* menuNameP, int8_t entryCount, scrollDrawCallbac

lcd_lib_clear_string_centerP(1, menuNameP);

entryDetailsCallback(selIndex);
if (entryDetailsCallback)
{
entryDetailsCallback(selIndex);
}

lcd_lib_update_screen();
}
Expand Down
42 changes: 28 additions & 14 deletions Marlin/UltiLCD2_low_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,30 +819,44 @@ void lcd_lib_clear_gfx(uint8_t x, uint8_t y, const uint8_t* gfx)
}
}

#define _BEEP(c, n) for(int8_t _i=0;_i<c;_i++) { WRITE(BEEPER, HIGH); _delay_us(n); WRITE(BEEPER, LOW); _delay_us(n); }
void lcd_lib_keyclick()
{
if (ui_mode & UI_BEEP_OFF)
{
return;
}
else if (ui_mode & UI_BEEP_SHORT)
{
_BEEP(15, 60);
_BEEP(10, 50);
}
else
{
lcd_lib_beep();
}
}

void lcd_lib_beep()
{
#define _BEEP(c, n) for(int8_t _i=0;_i<c;_i++) { WRITE(BEEPER, HIGH); _delay_us(n); WRITE(BEEPER, LOW); _delay_us(n); }
_BEEP(20, 366);
_BEEP(10, 150);
#undef _BEEP
}

//-----------------------------------------------------------------------------------------------------------------
// very short tick for UI feedback -- 1 millisecond long
void lcd_lib_tick( )
void lcd_lib_tick()
{
#if EXTENDED_BEEP
for (int a =0; a<10; ++a)
{
WRITE(BEEPER, HIGH);
_delay_us (50);
WRITE(BEEPER, LOW);
_delay_us(50);
}
// WRITE(BEEPER,0);
#endif

_BEEP(10, 50);
// for (int a =0; a<10; ++a)
// {
// WRITE(BEEPER, HIGH);
// _delay_us (50);
// WRITE(BEEPER, LOW);
// _delay_us(50);
// }
}
#undef _BEEP


int8_t lcd_lib_encoder_pos_interrupt = 0;
Expand Down
1 change: 1 addition & 0 deletions Marlin/UltiLCD2_low_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void lcd_lib_clear_gfx(uint8_t x, uint8_t y, const uint8_t* gfx);

void lcd_lib_beep();
void lcd_lib_tick();
void lcd_lib_keyclick();
void lcd_lib_buttons_update();
void lcd_lib_buttons_update_interrupt();
void lcd_lib_led_color(uint8_t r, uint8_t g, uint8_t b);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/UltiLCD2_menu_first_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static void lcd_menu_first_run_material_load_forward()

if (!blocks_queued())
{
lcd_lib_beep();
lcd_lib_keyclick();
// led_glow_dir = led_glow = 0;
digipot_current(2, motor_current_setting[2]*2/3);//Set E motor power lower so the motor will skip instead of grind.
menu.replace_menu(menu_t(lcd_menu_first_run_material_load_wait));
Expand Down
Loading

0 comments on commit a73822c

Please sign in to comment.