Browse Source

Merge pull request #5343 from thinkyhead/rc_invert_case_light

Allow case light pin to be active low
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
b0361ebe4f
  1. 7
      Marlin/Configuration_adv.h
  2. 4
      Marlin/Marlin_main.cpp
  3. 7
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  4. 7
      Marlin/example_configurations/Felix/Configuration_adv.h
  5. 7
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  6. 7
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  7. 7
      Marlin/example_configurations/K8200/Configuration_adv.h
  8. 7
      Marlin/example_configurations/K8400/Configuration_adv.h
  9. 7
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  10. 7
      Marlin/example_configurations/SCARA/Configuration_adv.h
  11. 7
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  12. 7
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  13. 7
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  14. 7
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  15. 7
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  16. 7
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  17. 7
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  18. 7
      Marlin/example_configurations/makibox/Configuration_adv.h
  19. 7
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  20. 4
      Marlin/ultralcd.cpp

7
Marlin/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

4
Marlin/Marlin_main.cpp

@ -7328,8 +7328,8 @@ inline void gcode_M907() {
uint8_t case_light_brightness = 255;
void update_case_light() {
digitalWrite(CASE_LIGHT_PIN, case_light_on ? HIGH : LOW);
analogWrite(CASE_LIGHT_PIN, case_light_on ? case_light_brightness : 0);
digitalWrite(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? HIGH : LOW);
analogWrite(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? case_light_brightness : 0);
}
/**

7
Marlin/example_configurations/Cartesio/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/Felix/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/Hephestos/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/Hephestos_2/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/K8200/Configuration_adv.h

@ -239,8 +239,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/K8400/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/RigidBot/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/SCARA/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/TAZ4/Configuration_adv.h

@ -234,8 +234,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/WITBOX/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/delta/generic/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h

@ -231,8 +231,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/makibox/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

7
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

@ -226,8 +226,11 @@
// Define a pin to turn case light on/off
//#define CASE_LIGHT_PIN 4
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#if PIN_EXISTS(CASE_LIGHT)
#define INVERT_CASE_LIGHT false // Set to true if HIGH is the OFF state (active low)
//#define CASE_LIGHT_DEFAULT_ON // Uncomment to set default state to on
//#define MENU_ITEM_CASE_LIGHT // Uncomment to have a Case Light On / Off entry in main menu
#endif
//===========================================================================
//============================ Mechanical Settings ==========================

4
Marlin/ultralcd.cpp

@ -581,7 +581,7 @@ void kill_screen(const char* lcd_msg) {
#endif //SDSUPPORT
#if HAS_CASE_LIGHT && ENABLED(MENU_ITEM_CASE_LIGHT)
#if ENABLED(MENU_ITEM_CASE_LIGHT)
extern bool case_light_on;
extern void update_case_light();
@ -607,7 +607,7 @@ void kill_screen(const char* lcd_msg) {
//
// Switch case light on/off
//
#if HAS_CASE_LIGHT && ENABLED(MENU_ITEM_CASE_LIGHT)
#if ENABLED(MENU_ITEM_CASE_LIGHT)
if (case_light_on)
MENU_ITEM(function, MSG_LIGHTS_OFF, toggle_case_light);
else

Loading…
Cancel
Save