diff options
Diffstat (limited to 'tmk_core/common/host.h')
| -rw-r--r-- | tmk_core/common/host.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/tmk_core/common/host.h b/tmk_core/common/host.h index e70bb6853..3d172eed6 100644 --- a/tmk_core/common/host.h +++ b/tmk_core/common/host.h | |||
| @@ -15,14 +15,18 @@ You should have received a copy of the GNU General Public License | |||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #ifndef HOST_H | 18 | #pragma once |
| 19 | #define HOST_H | ||
| 20 | 19 | ||
| 21 | #include <stdint.h> | 20 | #include <stdint.h> |
| 22 | #include <stdbool.h> | 21 | #include <stdbool.h> |
| 23 | #include "report.h" | 22 | #include "report.h" |
| 24 | #include "host_driver.h" | 23 | #include "host_driver.h" |
| 25 | 24 | ||
| 25 | #define IS_LED_ON(leds, led_name) ( (leds) & (1 << (led_name))) | ||
| 26 | #define IS_LED_OFF(leds, led_name) (~(leds) & (1 << (led_name))) | ||
| 27 | |||
| 28 | #define IS_HOST_LED_ON(led_name) IS_LED_ON(host_keyboard_leds(), led_name) | ||
| 29 | #define IS_HOST_LED_OFF(led_name) IS_LED_OFF(host_keyboard_leds(), led_name) | ||
| 26 | 30 | ||
| 27 | #ifdef __cplusplus | 31 | #ifdef __cplusplus |
| 28 | extern "C" { | 32 | extern "C" { |
| @@ -31,7 +35,6 @@ extern "C" { | |||
| 31 | extern uint8_t keyboard_idle; | 35 | extern uint8_t keyboard_idle; |
| 32 | extern uint8_t keyboard_protocol; | 36 | extern uint8_t keyboard_protocol; |
| 33 | 37 | ||
| 34 | |||
| 35 | /* host driver */ | 38 | /* host driver */ |
| 36 | void host_set_driver(host_driver_t *driver); | 39 | void host_set_driver(host_driver_t *driver); |
| 37 | host_driver_t *host_get_driver(void); | 40 | host_driver_t *host_get_driver(void); |
| @@ -46,14 +49,6 @@ void host_consumer_send(uint16_t data); | |||
| 46 | uint16_t host_last_system_report(void); | 49 | uint16_t host_last_system_report(void); |
| 47 | uint16_t host_last_consumer_report(void); | 50 | uint16_t host_last_consumer_report(void); |
| 48 | 51 | ||
| 49 | #define IS_LED_ON(USB_LED, LED_NAME) ((USB_LED) & (1 << (LED_NAME))) | ||
| 50 | #define IS_LED_OFF(USB_LED, LED_NAME) (~(USB_LED) & (1 << (LED_NAME))) | ||
| 51 | |||
| 52 | #define IS_HOST_LED_ON(LED_NAME) IS_LED_ON(host_keyboard_leds(), (LED_NAME)) | ||
| 53 | #define IS_HOST_LED_OFF(LED_NAME) IS_LED_OFF(host_keyboard_leds(), (LED_NAME)) | ||
| 54 | |||
| 55 | #ifdef __cplusplus | 52 | #ifdef __cplusplus |
| 56 | } | 53 | } |
| 57 | #endif | 54 | #endif |
| 58 | |||
| 59 | #endif | ||
