logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

os_detection.h (1658B)


  1. /* Copyright 2022 Ruslan Sayfutdinov (@KapJI)
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include <stdint.h>
  18. #include <stdbool.h>
  19. #include "usb_device_state.h"
  20. typedef enum {
  21. OS_UNSURE,
  22. OS_LINUX,
  23. OS_WINDOWS,
  24. OS_MACOS,
  25. OS_IOS,
  26. } os_variant_t;
  27. void process_wlength(const uint16_t w_length);
  28. os_variant_t detected_host_os(void);
  29. void erase_wlength_data(void);
  30. void os_detection_notify_usb_device_state_change(struct usb_device_state usb_device_state);
  31. void os_detection_task(void);
  32. bool process_detected_host_os_kb(os_variant_t os);
  33. bool process_detected_host_os_user(os_variant_t os);
  34. #if defined(SPLIT_KEYBOARD) && defined(SPLIT_DETECTED_OS_ENABLE)
  35. void slave_update_detected_host_os(os_variant_t os);
  36. #endif
  37. #ifdef OS_DETECTION_DEBUG_ENABLE
  38. # if defined(DYNAMIC_KEYMAP_ENABLE) || defined(VIA_ENABLE)
  39. # error Cannot enable OS Detection debug mode simultaneously with DYNAMIC_KEYMAP or VIA
  40. # endif
  41. void print_stored_setups(void);
  42. void store_setups_in_eeprom(void);
  43. #endif