Code Monkey home page Code Monkey logo

marlin's People

Contributors

alexborro avatar anhardt avatar bkubicek avatar blubbfish avatar boelle avatar buildrob avatar chron0 avatar consulitas avatar croadfeldt avatar cylindric avatar daid avatar drf5n avatar epatel avatar erikzalm avatar ixce avatar jbrazio avatar jcrocholl avatar magokimbra avatar maikstohn avatar maverikou avatar neildarlow avatar nothinman avatar scuba82 avatar stb3 avatar stv0g avatar thinkyhead avatar wackerbarth avatar whosawhatsis avatar wolfmanjm avatar wurstnase avatar

Stargazers

 avatar

Watchers

 avatar  avatar

marlin's Issues

Array troubles

@Roxy-3D,

I have an issue with this and unsure what to do.

    void _lcd_set_led_color() {
      const char *_colors[10] = {
        MSG_LCD_RED,         // 0  -- color_number
        MSG_LCD_GREEN,       // 1
        MSG_LCD_BLUE,        // 2
        MSG_LCD_AQUA,        // 3
        MSG_LCD_YELLOW,      // 4
        MSG_LCD_PURPLE,      // 5
        MSG_LCD_PINK,        // 6
        MSG_LCD_AMBER,       // 7
        MSG_LCD_BLACKLIGHT,  // 8
        MSG_LCD_WATERMELON   // 9
      };

      START_MENU();
      MENU_ITEM(back, MSG_LED_LIGHTING, lcd_main_menu);
      MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);
      MENU_ITEM(submenu, MSG_LCD_RGB_EDIT, _lcd_set_rgb_color);
      MENU_ITEM(function, MSG_LCD_COLOR_RESET, _lcd_set_led_color_reset);
      END_MENU();
    }

This compiles and works just fine with the Re-ARM, I do see the linter errors are exactly the same as AVR.
The compiler errors in the Arduino IDE for the Mega2560:

sketch\ultralcd.cpp: In function 'void _lcd_set_led_color()':

ultralcd.cpp:305: error: initializer fails to determine size of '__c'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                                                                      ^

sketch\ultralcd.cpp:253:30: note: in definition of macro '_MENU_ITEM_PART_2'

         menu_action_ ## TYPE(__VA_ARGS__); \

                              ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

ultralcd.cpp:305: error: array must be initialized with a brace-enclosed initializer

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                                                                      ^

sketch\ultralcd.cpp:253:30: note: in definition of macro '_MENU_ITEM_PART_2'

         menu_action_ ## TYPE(__VA_ARGS__); \

                              ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

In file included from C:\Users\JASON\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.19\cores\arduino/Arduino.h:28:0,

                 from sketch\src/HAL/HAL_AVR/HAL_AVR.h:38,

                 from sketch\src/HAL/HAL.h:81,

                 from sketch\MarlinConfig.h:27,

                 from sketch\Marlin.h:31,

                 from sketch\ultralcd.h:26,

                 from sketch\ultralcd.cpp:23:

ultralcd.cpp:257: error: initializer fails to determine size of '__c'

         lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \

                                                                                      ^

sketch\ultralcd.cpp:264:7: note: in expansion of macro '_MENU_ITEM_PART_2'

       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \

       ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

ultralcd.cpp:257: error: array must be initialized with a brace-enclosed initializer

         lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \

                                                                                      ^

sketch\ultralcd.cpp:264:7: note: in expansion of macro '_MENU_ITEM_PART_2'

       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \

       ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

ultralcd.cpp:305: error: initializer fails to determine size of '__c'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                                                                      ^

sketch\ultralcd.cpp:264:7: note: in expansion of macro '_MENU_ITEM_PART_2'

       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \

       ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

ultralcd.cpp:305: error: array must be initialized with a brace-enclosed initializer

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                                                                      ^

sketch\ultralcd.cpp:264:7: note: in expansion of macro '_MENU_ITEM_PART_2'

       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \

       ^

sketch\ultralcd.cpp:305:53: note: in expansion of macro 'MENU_ITEM'

   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)

                                                     ^

sketch\ultralcd.cpp:3068:7: note: in expansion of macro 'MENU_ITEM_EDIT_CALLBACK'

       MENU_ITEM_EDIT_CALLBACK(int3, _colors[color_number], &color_number, 0, 9, _color_select);

       ^

exit status 1
initializer fails to determine size of '__c'

Help wanted

@Roxy-3D, I was hoping you could tell me if there is a cleaner way of doing the following?

These are conditionals to defining the different colors, but only if the specified color is needed.

#if ENABLED(PRINTER_EVENT_LEDS)
  #if ENABLED(HOMING_EVENT) == RED || ENABLED(LEVELING_EVENT) == RED || ENABLED(UBL_LOAD_EVENT) == RED || ENABLED(UBL_SAVE_EVENT) == RED || ENABLED(ADVANCED_PAUSE_EVENT) == RED || ENABLED(PAUSED_TIMEOUT) == RED
    #define RED 255, 0, 0, 0
  #endif
  #if ENABLED(HOMING_EVENT) == GREEN || ENABLED(LEVELING_EVENT) == GREEN || ENABLED(UBL_LOAD_EVENT) == GREEN || ENABLED(UBL_SAVE_EVENT) == GREEN || ENABLED(ADVANCED_PAUSE_EVENT) == GREEN || ENABLED(PAUSED_TIMEOUT) == GREEN
    #define GREEN 0, 255, 0, 0
  #endif
  #if ENABLED(HOMING_EVENT) == BLUE || ENABLED(LEVELING_EVENT) == BLUE || ENABLED(UBL_LOAD_EVENT) == BLUE || ENABLED(UBL_SAVE_EVENT) == BLUE || ENABLED(ADVANCED_PAUSE_EVENT) == BLUE || ENABLED(PAUSED_TIMEOUT) == BLUE
    #define BLUE 0, 0, 255, 0
  #endif
  #if ENABLED(HOMING_EVENT) == YELLOW || ENABLED(LEVELING_EVENT) == YELLOW || ENABLED(UBL_LOAD_EVENT) == YELLOW || ENABLED(UBL_SAVE_EVENT) == YELLOW || ENABLED(ADVANCED_PAUSE_EVENT) == YELLOW || ENABLED(PAUSED_TIMEOUT) == YELLOW
    #define YELLOW 255, 255, 0, 0
  #endif
  #if ENABLED(HOMING_EVENT) == PURPLE || ENABLED(LEVELING_EVENT) == PURPLE || ENABLED(UBL_LOAD_EVENT) == PURPLE || ENABLED(UBL_SAVE_EVENT) == PURPLE || ENABLED(ADVANCED_PAUSE_EVENT) == PURPLE || ENABLED(PAUSED_TIMEOUT) == PURPLE
    #define PURPLE 255, 0, 255, 0
  #endif
  #if ENABLED(HOMING_EVENT) == TEAL || ENABLED(LEVELING_EVENT) == TEAL || ENABLED(UBL_LOAD_EVENT) == TEAL || ENABLED(UBL_SAVE_EVENT) == TEAL || ENABLED(ADVANCED_PAUSE_EVENT) == TEAL || ENABLED(PAUSED_TIMEOUT) == TEAL
    #define TEAL 0, 255, 255, 0
  #endif
  #if ENABLED(HOMING_EVENT) == TEAL_HALF || ENABLED(LEVELING_EVENT) == TEAL_HALF || ENABLED(UBL_LOAD_EVENT) == TEAL_HALF || ENABLED(UBL_SAVE_EVENT) == TEAL_HALF || ENABLED(ADVANCED_PAUSE_EVENT) == TEAL_HALF || ENABLED(PAUSED_TIMEOUT) == TEAL_HALF
    #define TEAL_HALF 0, 127, 127, 0
  #endif
  #if ENABLED(HOMING_EVENT) == BLACKLIGHT || ENABLED(LEVELING_EVENT) == BLACKLIGHT || ENABLED(UBL_LOAD_EVENT) == BLACKLIGHT || ENABLED(UBL_SAVE_EVENT) == BLACKLIGHT || ENABLED(ADVANCED_PAUSE_EVENT) == BLACKLIGHT || ENABLED(PAUSED_TIMEOUT) == BLACKLIGHT
    #define BLACKLIGHT 167, 0, 255, 0
  #endif
  #if ENABLED(HOMING_EVENT) == WATERMELON || ENABLED(LEVELING_EVENT) == WATERMELON || ENABLED(UBL_LOAD_EVENT) == WATERMELON || ENABLED(UBL_SAVE_EVENT) == WATERMELON || ENABLED(ADVANCED_PAUSE_EVENT) == WATERMELON || ENABLED(PAUSED_TIMEOUT) == WATERMELON
    #define WATERMELON 255, 90, 90, 0
  #endif
  #if ENABLED(HOMING_EVENT) == AMBER || ENABLED(LEVELING_EVENT) == AMBER || ENABLED(UBL_LOAD_EVENT) == AMBER || ENABLED(UBL_SAVE_EVENT) == AMBER || ENABLED(ADVANCED_PAUSE_EVENT) == AMBER || ENABLED(PAUSED_TIMEOUT) == AMBER
    #define AMBER 183, 255, 0, 0
  #endif
  #if ENABLED(HOMING_EVENT) == ORANGE || ENABLED(LEVELING_EVENT) == ORANGE || ENABLED(UBL_LOAD_EVENT) == ORANGE || ENABLED(UBL_SAVE_EVENT) == ORANGE || ENABLED(ADVANCED_PAUSE_EVENT) == ORANGE || ENABLED(PAUSED_TIMEOUT) == ORANGE
    #define ORANGE 255, 75, 0, 0
  #endif
  #if ENABLED(HOMING_EVENT) == ROSE || ENABLED(LEVELING_EVENT) == ROSE || ENABLED(UBL_LOAD_EVENT) == ROSE || ENABLED(UBL_SAVE_EVENT) == ROSE || ENABLED(ADVANCED_PAUSE_EVENT) == ROSE || ENABLED(PAUSED_TIMEOUT) == ROSE
    #define ROSE 255, 0, 50, 0
  #endif
  #define LEDS_OFF 0, 0, 0, 0
#endif

This is how the colors are defined:

#if ENABLED(PRINTER_EVENT_LEDS)
  #define HOMING_EVENT           YELLOW
  #define LEVELING_EVENT         BLACKLIGHT
  #define UBL_LOAD_EVENT         AMBER
  #define UBL_SAVE_EVENT         ORANGE
  #define ADVANCED_PAUSE_EVENT   TEAL
  #define PAUSED_TIMEOUT_EVENT   TEAL_HALF
#endif

LCD SD Print

@Bob-the-Kuhn,
I'm trying this now. I did see the file list and selected the file and clicked to print. The screen went all wacky then and stays like that. I clicked the encoder and nothing happened. I rotated the encoder to the right about 1/2 turn then clicked and I got the main menu.

LCD not displaying on a second attempt.

@thinkyhead,

In the current PR 7231, when selecting Output Mesh Map from the LCD, Homing XYZ displays just fine.
If I disable the steppers manually by M84 or Disable Steppers from the LCD, (or let them timeout), when selecting the Output Mesh Map from the LCD again the Homing XYZ doesn't display and it goes on to the map once the homing is complete.
I can get it to display again, only if I reset Marlin. But, it's back again to the issue above.

All else works just fine.

I've tried multiple different things...Nothing is working, what am I missing?

UBL matrix plotting

@Roxy-3D, I have a draft here to check out:

https://github.com/Tannoo/Marlin/tree/UBL_mesh_plot

Working:
Matrix is represented, not the build platform.
Grid box is two steps larger than any grid
X/Y nozzle locations (top of screen)
X/Y grid locations (bottom of screen)
Z value of grid location (bottom of screen)
'delta' circle that will overlay the matrix when (IS_KINEMATIC).
Encoder working 'on the fly' to select points.
Click on map point will invoke editing that point.
Editing will return to the "radar" to select another point.
"Radar" screen will time out to status screen.
UBL's 'click and hold' to cancel edit will exit this also.

TODO:
Scale up 3x3 "radar"

Re-ARM and 20x4 LCD Panel

Hey! Let me know if you have any trouble getting the current code to compile and load on the Re-ARM board. A lot of stuff is not intuitive. I had some trouble getting the code to compile and load. I wasn't even sure if I was opening the project the right way.

So... Don't waste too much time trying to figure things out on your own.

How hard do you think it will be to get the 20x4 LCD Panel displaying something? I'm hoping it will come up easily but that is probably not likely. But the machine I want to put the Re-ARM board on has a 20x4 LCD display, so that is part of the reason for the question.

And once it can compile... Even if it doesn't work... I can probably jump in and help with debugging.

UBL LCD "Radar"

@Roxy-3D, take a look... 10x10 matrix:
radar 45
radar 45 mapped

I have to set the coordinates first, then go map it.
Need to get encoder working to change the values dynamically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.