mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-22 03:19:24 +00:00
OS Detection - Entire file should not be wrapped with ifdef (#23108)
This commit is contained in:
parent
8df2e70ae4
commit
9f95577ef2
@ -16,8 +16,6 @@
|
||||
|
||||
#include "os_detection.h"
|
||||
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
|
||||
#include <string.h>
|
||||
#include "timer.h"
|
||||
#ifdef OS_DETECTION_KEYBOARD_RESET
|
||||
@ -35,6 +33,16 @@
|
||||
static uint16_t usb_setups[STORED_USB_SETUPS];
|
||||
#endif
|
||||
|
||||
#ifndef OS_DETECTION_DEBOUNCE
|
||||
# define OS_DETECTION_DEBOUNCE 200
|
||||
#endif
|
||||
|
||||
// 2s should always be more than enough (otherwise, you may have other issues)
|
||||
#if OS_DETECTION_DEBOUNCE > 2000
|
||||
# undef OS_DETECTION_DEBOUNCE
|
||||
# define OS_DETECTION_DEBOUNCE 2000
|
||||
#endif
|
||||
|
||||
struct setups_data_t {
|
||||
uint8_t count;
|
||||
uint8_t cnt_02;
|
||||
@ -50,18 +58,6 @@ struct setups_data_t setups_data = {
|
||||
.cnt_ff = 0,
|
||||
};
|
||||
|
||||
# ifndef OS_DETECTION_DEBOUNCE
|
||||
# define OS_DETECTION_DEBOUNCE 200
|
||||
# endif
|
||||
|
||||
// 2s should always be more than enough (otherwise, you may have other issues)
|
||||
# if OS_DETECTION_DEBOUNCE > 2000
|
||||
# undef OS_DETECTION_DEBOUNCE
|
||||
# define OS_DETECTION_DEBOUNCE 2000
|
||||
# endif
|
||||
|
||||
typedef uint16_t debouncing_t;
|
||||
|
||||
static volatile os_variant_t detected_os = OS_UNSURE;
|
||||
static os_variant_t reported_os = OS_UNSURE;
|
||||
|
||||
@ -202,5 +198,3 @@ void store_setups_in_eeprom(void) {
|
||||
}
|
||||
|
||||
#endif // OS_DETECTION_DEBUG_ENABLE
|
||||
|
||||
#endif
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "usb_device_state.h"
|
||||
@ -48,5 +46,3 @@ void slave_update_detected_host_os(os_variant_t os);
|
||||
void print_stored_setups(void);
|
||||
void store_setups_in_eeprom(void);
|
||||
#endif
|
||||
|
||||
#endif // OS_DETECTION_ENABLE
|
||||
|
Loading…
Reference in New Issue
Block a user