aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/buttons.py
Commit message (Collapse)AuthorAgeFilesLines
* buttons: Improve python3 compatibilityKevin O'Connor2020-09-041-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Rename try_load_module() to load_object()Kevin O'Connor2020-05-081-1/+1
| | | | | | | | Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* query_adc: Add a new module to help query and debug analog pinsKevin O'Connor2019-11-071-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Only call into main thread on an adc button changeKevin O'Connor2019-11-071-17/+13
| | | | | | | Determine the selected button (and if it has changed) in the background thread first. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: No need to check for None on min_value/max_valueKevin O'Connor2019-11-071-21/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Remove MCU_ADC_buttons debug capabilityKevin O'Connor2019-11-071-11/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: initialize mcu buttons based on inverted stateArksine2019-07-051-2/+3
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* serialhdl: Rename register_callback() to register_response()Kevin O'Connor2019-06-211-2/+2
| | | | | | Rename the method and use that name in the mcu class as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Minor code movementKevin O'Connor2019-05-261-37/+43
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* menu: initial support for analog buttons (#977)Janar Sööt2019-04-141-0/+91
| | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* buttons: Wrap code to 80 columnsKevin O'Connor2019-02-271-5/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Rename add_config_object() to register_config_callback()Kevin O'Connor2018-09-031-1/+1
| | | | | | | | | Change the name of the config registration method and pass an explicit reference to the callback to the new method. This makes the relationship between mcu registration and build_config() more clear in the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Explicitly pass can_invert and can_pullup to lookup_pin()Kevin O'Connor2018-07-261-1/+1
| | | | | | | | | | | | Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Improve rotary encoder handler by using Ben Buxton state machine. ↵Janar Sööt2018-07-011-11/+35
| | | | | | | (#445) https://github.com/brianlow/Rotary Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* buttons: Add initial support for detecting button pressesKevin O'Connor2018-06-301-0/+143
Add mcu support for periodically polling for a button press. Add host code support for registering buttons and invoking callbacks for them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>