Browse Source

Merge pull request #743 from Opticalworm/Marlin_v1

Improved support for panelolu2 encoder and buzzer
ErikZalm 10 years ago
parent
commit
e1ae7952eb

+ 21
- 23
ArduinoAddons/Arduino_1.x.x/hardware/Sanguino/boards.txt View File

@@ -27,9 +27,9 @@ atmega12848m.upload.protocol=stk500
27 27
 atmega12848m.upload.maximum_size=131072
28 28
 atmega12848m.upload.speed=19200
29 29
 
30
-atmega12848m.bootloader.low_fuses=0xFD
31
-atmega12848m.bootloader.high_fuses=0x9A
32
-atmega12848m.bootloader.extended_fuses=0xFF
30
+atmega1284.bootloader.low_fuses=0xD6
31
+atmega1284.bootloader.high_fuses=0xDA
32
+atmega1284.bootloader.extended_fuses=0xFD
33 33
 atmega12848m.bootloader.path=atmega
34 34
 atmega12848m.bootloader.file=ATmegaBOOT_168_atmega1284p_8m.hex
35 35
 atmega12848m.bootloader.unlock_bits=0x3F
@@ -48,9 +48,9 @@ atmega1284.upload.protocol=stk500
48 48
 atmega1284.upload.maximum_size=131072
49 49
 atmega1284.upload.speed=57600
50 50
 
51
-atmega1284.bootloader.low_fuses=0xFF
52
-atmega1284.bootloader.high_fuses=0x9A
53
-atmega1284.bootloader.extended_fuses=0xFF
51
+atmega1284.bootloader.low_fuses=0xD6
52
+atmega1284.bootloader.high_fuses=0xDA
53
+atmega1284.bootloader.extended_fuses=0xFD
54 54
 atmega1284.bootloader.path=atmega
55 55
 atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
56 56
 atmega1284.bootloader.unlock_bits=0x3F
@@ -60,26 +60,24 @@ atmega1284.build.mcu=atmega1284p
60 60
 atmega1284.build.f_cpu=16000000L
61 61
 atmega1284.build.core=arduino
62 62
 atmega1284.build.variant=standard
63
-#
64
-
65 63
 ##############################################################
66 64
 
67
-atmega1284.name=Sanguino W/ ATmega1284p 16mhz ceramic resonator
65
+atmega1284m.name=Sanguino W/ ATmega1284p 20mhz
68 66
 
69
-atmega1284.upload.protocol=stk500
70
-atmega1284.upload.maximum_size=131072
71
-atmega1284.upload.speed=57600
67
+atmega1284m.upload.protocol=stk500
68
+atmega1284m.upload.maximum_size=131072
69
+atmega1284m.upload.speed=57600
72 70
 
73
-atmega1284.bootloader.low_fuses=0xD6
74
-atmega1284.bootloader.high_fuses=0xDC
75
-atmega1284.bootloader.extended_fuses=0xFD
76
-atmega1284.bootloader.path=atmega
77
-atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
78
-atmega1284.bootloader.unlock_bits=0x3F
79
-atmega1284.bootloader.lock_bits=0x0F
71
+atmega1284m.bootloader.low_fuses=0xD6
72
+atmega1284m.bootloader.high_fuses=0xDA
73
+atmega1284m.bootloader.extended_fuses=0xFD
74
+atmega1284m.bootloader.path=atmega
75
+atmega1284m.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
76
+atmega1284m.bootloader.unlock_bits=0x3F
77
+atmega1284m.bootloader.lock_bits=0x0F
80 78
 
81
-atmega1284.build.mcu=atmega1284p
82
-atmega1284.build.f_cpu=16000000L
83
-atmega1284.build.core=arduino
84
-atmega1284.build.variant=standard
79
+atmega1284m.build.mcu=atmega1284p
80
+atmega1284m.build.f_cpu=20000000L
81
+atmega1284m.build.core=arduino
82
+atmega1284m.build.variant=standard
85 83
 #

+ 17
- 0
Marlin/Configuration.h View File

@@ -451,6 +451,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
451 451
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
452 452
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
453 453
 //#define ULTIPANEL  //the ultipanel as on thingiverse
454
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
455
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
454 456
 
455 457
 // The MaKr3d Makr-Panel with graphic controller and SD support
456 458
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
@@ -536,6 +538,21 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
536 538
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
537 539
   #define NEWPANEL
538 540
   #define ULTIPANEL
541
+  
542
+  #ifndef ENCODER_PULSES_PER_STEP
543
+	#define ENCODER_PULSES_PER_STEP 4
544
+  #endif 
545
+
546
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
547
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
548
+  #endif 
549
+  
550
+  
551
+  #ifdef LCD_USE_I2C_BUZZER
552
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
553
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
554
+  #endif
555
+  
539 556
 #endif
540 557
 
541 558
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs

+ 9
- 3
Marlin/Marlin_main.cpp View File

@@ -2477,7 +2477,7 @@ void process_commands()
2477 2477
       break;
2478 2478
     #endif // NUM_SERVOS > 0
2479 2479
 
2480
-    #if LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) )
2480
+    #if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
2481 2481
     case 300: // M300
2482 2482
     {
2483 2483
       int beepS = code_seen('S') ? code_value() : 110;
@@ -2489,7 +2489,9 @@ void process_commands()
2489 2489
           delay(beepP);
2490 2490
           noTone(BEEPER);
2491 2491
         #elif defined(ULTRALCD)
2492
-          lcd_buzz(beepS, beepP);
2492
+		  lcd_buzz(beepS, beepP);
2493
+		#elif defined(LCD_USE_I2C_BUZZER)
2494
+		  lcd_buzz(beepP, beepS);
2493 2495
         #endif
2494 2496
       }
2495 2497
       else
@@ -2747,7 +2749,11 @@ void process_commands()
2747 2749
             WRITE(BEEPER,LOW);
2748 2750
             delay(3);
2749 2751
           #else
2750
-            lcd_buzz(1000/6,100);
2752
+			#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
2753
+              lcd_buzz(1000/6,100);
2754
+			#else
2755
+			  lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS,LCD_FEEDBACK_FREQUENCY_HZ);
2756
+			#endif
2751 2757
           #endif
2752 2758
           }
2753 2759
         }

+ 4
- 0
Marlin/pins.h View File

@@ -971,6 +971,10 @@
971 971
 #undef MOTHERBOARD
972 972
 #define MOTHERBOARD 6
973 973
 #define SANGUINOLOLU_V_1_2
974
+
975
+#if defined(__AVR_ATmega1284P__)
976
+	#define LARGE_FLASH true
977
+#endif
974 978
 #endif
975 979
 #if MOTHERBOARD == 6
976 980
 #define KNOWN_BOARD 1

+ 5
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -711,7 +711,11 @@ static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pst
711 711
 static void lcd_implementation_quick_feedback()
712 712
 {
713 713
 #ifdef LCD_USE_I2C_BUZZER
714
-    lcd.buzz(60,1000/6);
714
+	#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
715
+	  lcd_buzz(1000/6,100);
716
+	#else
717
+	  lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS,LCD_FEEDBACK_FREQUENCY_HZ);
718
+	#endif
715 719
 #elif defined(BEEPER) && BEEPER > -1
716 720
     SET_OUTPUT(BEEPER);
717 721
     for(int8_t i=0;i<10;i++)

Loading…
Cancel
Save