Added Lemokey P1 Pro

This commit is contained in:
lokher 2024-08-21 11:20:44 +08:00
commit 62030ee6bb
72 changed files with 2876 additions and 507 deletions

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ lokher (https://www.keychron.com)
/* Copyright 2022~2024 @ lokher (https://www.keychron.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,9 @@
#include "config.h"
#include "wireless.h"
#define P24G_HOST_INDEX 24
#define USB_HOST_INDEX 34
/* Indication of pairing */
#ifndef INDICATOR_CONFIG_PARING
# define INDICATOR_CONFIG_PARING {INDICATOR_BLINK, 1000, 1000, 0, true, 0};
@ -41,45 +44,43 @@
/* Uint: Second */
#ifndef DISCONNECTED_BACKLIGHT_DISABLE_TIMEOUT
# define DISCONNECTED_BACKLIGHT_OFF_DELAY_TIME 40
# define DISCONNECTED_BACKLIGHT_DISABLE_TIMEOUT 40
#endif
/* Uint: Second, the timer restarts on key activities. */
#ifndef CONNECTED_BACKLIGHT_DISABLE_TIMEOUT
# define CONNECTED_BACKLIGHT_OFF_DELAY_TIME 600
# define CONNECTED_BACKLIGHT_DISABLE_TIMEOUT 600
#endif
#ifdef BAT_LOW_LED_PIN
/* Uint: ms */
# ifndef LOW_BAT_LED_BLINK_PERIOD
# define LOW_BAT_LED_BLINK_PERIOD 1000
# endif
# ifndef LOW_BAT_LED_BLINK_DURATION
# define LOW_BAT_LED_BLINK_DURATION 10000
# endif
#ifndef LOW_BAT_LED_BLINK_PERIOD
# define LOW_BAT_LED_BLINK_PERIOD 1000
#endif
#ifdef LOW_BAT_IND_INDEX
/* Uint: ms */
# ifndef LOW_BAT_LED_BLINK_PERIOD
# define LOW_BAT_LED_BLINK_PERIOD 500
# endif
#ifndef LOW_BAT_LED_BLINK_TIMES
# define LOW_BAT_LED_BLINK_TIMES 5
#endif
# ifndef LOW_BAT_LED_BLINK_TIMES
# define LOW_BAT_LED_BLINK_TIMES 3
# endif
#ifndef LOW_BAT_LED_TRIG_INTERVAL
# define LOW_BAT_LED_TRIG_INTERVAL 30000
#endif
# ifndef LOW_BAT_LED_TRIG_INTERVAL
# define LOW_BAT_LED_TRIG_INTERVAL 30000
# endif
#if ((defined(LED_MATRIX_ENABLE) || defined(RGB_MATRIX_ENABLE)) && defined(LOW_BAT_IND_INDEX))
# define SPACE_KEY_LOW_BAT_IND
#endif
#if BT_HOST_MAX_COUNT > 6
# pragma error("HOST_COUNT max value is 6")
#endif
typedef enum { INDICATOR_NONE, INDICATOR_OFF, INDICATOR_ON, INDICATOR_ON_OFF, INDICATOR_BLINK, INDICATOR_LAST } indicator_type_t;
typedef enum {
INDICATOR_NONE,
INDICATOR_OFF,
INDICATOR_ON,
INDICATOR_ON_OFF,
INDICATOR_BLINK,
INDICATOR_LAST,
} indicator_type_t;
typedef struct PACKED {
indicator_type_t type;
@ -98,6 +99,7 @@ typedef struct PACKED {
void indicator_init(void);
void indicator_set(wt_state_t state, uint8_t host_index);
void indicator_set_backlit_timeout(uint32_t time);
void indicator_backlight_timer_reset(bool enable);
bool indicator_hook_key(uint16_t keycode);
void indicator_enable(void);
@ -106,12 +108,6 @@ void indicator_stop(void);
void indicator_eeconfig_reload(void);
bool indicator_is_enabled(void);
bool indicator_is_running(void);
#ifdef BAT_LOW_LED_PIN
void indicator_battery_low_enable(bool enable);
#endif
#if defined(LOW_BAT_IND_INDEX)
void indicator_battery_low_backlit_enable(bool enable);
#endif
void indicator_task(void);