mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-25 02:12:40 +02:00
Initial potentiometer support
This commit is contained in:
@@ -60,6 +60,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef ENCODER_ENABLE
|
||||
# include "encoder.h"
|
||||
#endif
|
||||
#ifdef POTENTIOMETER_ENABLE
|
||||
# include "potentiometer.h"
|
||||
#endif
|
||||
#ifdef HAPTIC_ENABLE
|
||||
# include "haptic.h"
|
||||
#endif
|
||||
@@ -143,6 +146,9 @@ uint32_t last_input_activity_time(void) {
|
||||
uint32_t last_input_activity_elapsed(void) {
|
||||
return sync_timer_elapsed32(last_input_modification_time);
|
||||
}
|
||||
void last_input_activity_trigger(void) {
|
||||
last_input_modification_time = sync_timer_read32();
|
||||
}
|
||||
|
||||
static uint32_t last_matrix_modification_time = 0;
|
||||
uint32_t last_matrix_activity_time(void) {
|
||||
@@ -440,6 +446,9 @@ void keyboard_init(void) {
|
||||
#ifdef DIP_SWITCH_ENABLE
|
||||
dip_switch_init();
|
||||
#endif
|
||||
#ifdef POTENTIOMETER_ENABLE
|
||||
potentiometer_init();
|
||||
#endif
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_init();
|
||||
#endif
|
||||
@@ -669,6 +678,13 @@ void keyboard_task(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef POTENTIOMETER_ENABLE
|
||||
if (potentiometer_task()) {
|
||||
last_input_activity_trigger();
|
||||
activity_has_occurred = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
if (pointing_device_task()) {
|
||||
last_pointing_device_activity_trigger();
|
||||
|
||||
Reference in New Issue
Block a user