Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized parsing in interfaceCmd.c and parseACK.c + configurable M109/M190 #2156

Merged
merged 21 commits into from Sep 9, 2021

Conversation

digant73
Copy link
Contributor

@digant73 digant73 commented Sep 3, 2021

IMPROVEMENTS:

  • Optimized parsing code in interfaceCmd: Reduced the use of array indexing and used length of the key for a fast check on the buffer and matching/not matching conditions

  • Optimized parsing code in parseAck: Reduced conditions in the parsing functions to avoid as much as possible continue checks on the validity of the array elements (e.g. != 0). Used length L2 cache and key for a fast check on matching/not matching conditions. Major benefits are present when searching a key in the middle of L2 cache

  • Code reduction: Due to optimizations above

  • Configurable feature "emulated M109/M190": New param "emulated_m109_m190" added in config.ini to enable/disable M109/M190 emulated with M104/M140

  • Added rotary encoder support on List menu (list/icon menu): Rotary encoder can be used to navigate (page up/down) on any List menu without the need to use the page up/down buttons.

    NOTE: As for all the other menus supporting rotary encoder, the button on rotary encoder MUST/CAN NOT be used to apply an action on a list item (e.g. select the file to print). That's due to the HW shared with mainboard (Rotary encoder is physically connected to the mainboard and any press on rotary button will have effects also on Marlin menu).
    To apply an action on the item, you MUST continue to apply a touch on the screen

  • Minor cleanup in config.ini: Forgot to apply the following param rename in my prevoius PR:
    rotate_ui -> rotated_ui
    block_touch_on_idle -> lcd_lock_on_idle

  • Minor cleanup

BUGFIXES / FR:
fixes #2153
resolves #1974
resolves #2151

@digant73 digant73 changed the title Optimized parsing performance in interfaceCmd.c and parseACK.c + code… Optimized parsing in interfaceCmd.c and parseACK.c + configurable M109/M190 Sep 3, 2021
@bttguy
Copy link

bttguy commented Sep 4, 2021

Wow @digant73 you already implemented the encoder scroll?

@digant73
Copy link
Contributor Author

digant73 commented Sep 4, 2021

rotary encoder is now supported in both List/Icon modes

@bttguy
Copy link

bttguy commented Sep 4, 2021

rotary encoder is now supported in both List/Icon modes

Awesome! Huge thanks to you!!

@Tannoo
Copy link

Tannoo commented Sep 8, 2021

In TFT/src/User/API/config.c LN#557:

    case C_INDEX_EMULATED_M600:
    case C_INDEX_EMULATED_M109_M190:
      SET_BIT_VALUE(infoSettings.general_settings, (index - C_INDEX_EMULATED_M600), getOnOff());
      break;

Is this intentional or is something missing?

I am trying to implement this now and this doesn't make sense.

@digant73
Copy link
Contributor Author

digant73 commented Sep 8, 2021

yes, it is correct

@bigtreetech bigtreetech merged commit 0f89ae5 into bigtreetech:master Sep 9, 2021
jeffeb3 pushed a commit to V1EngineeringInc/BIGTREETECH-TouchScreenFirmware that referenced this pull request Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants