diff options
Diffstat (limited to 'quantum/split_common/split_util.c')
| -rw-r--r-- | quantum/split_common/split_util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 9af3c29d75..59b6009ec4 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 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/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | |||
| 17 | #include "compiler_support.h" | ||
| 16 | #include "split_util.h" | 18 | #include "split_util.h" |
| 17 | #include "matrix.h" | 19 | #include "matrix.h" |
| 18 | #include "keyboard.h" | 20 | #include "keyboard.h" |
| @@ -62,7 +64,7 @@ static struct { | |||
| 62 | } split_config; | 64 | } split_config; |
| 63 | 65 | ||
| 64 | #if defined(SPLIT_USB_DETECT) | 66 | #if defined(SPLIT_USB_DETECT) |
| 65 | _Static_assert((SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL) <= UINT16_MAX, "Please lower SPLIT_USB_TIMEOUT and/or increase SPLIT_USB_TIMEOUT_POLL."); | 67 | STATIC_ASSERT((SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL) <= UINT16_MAX, "Please lower SPLIT_USB_TIMEOUT and/or increase SPLIT_USB_TIMEOUT_POLL."); |
| 66 | static bool usb_bus_detected(void) { | 68 | static bool usb_bus_detected(void) { |
| 67 | for (uint16_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) { | 69 | for (uint16_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) { |
| 68 | // This will return true if a USB connection has been established | 70 | // This will return true if a USB connection has been established |
| @@ -88,9 +90,9 @@ static inline bool usb_bus_detected(void) { | |||
| 88 | # endif | 90 | # endif |
| 89 | # endif | 91 | # endif |
| 90 | # if defined(SPLIT_USB_DETECT) | 92 | # if defined(SPLIT_USB_DETECT) |
| 91 | _Static_assert(SPLIT_USB_TIMEOUT < SPLIT_WATCHDOG_TIMEOUT, "SPLIT_WATCHDOG_TIMEOUT should not be below SPLIT_USB_TIMEOUT."); | 93 | STATIC_ASSERT(SPLIT_USB_TIMEOUT < SPLIT_WATCHDOG_TIMEOUT, "SPLIT_WATCHDOG_TIMEOUT should not be below SPLIT_USB_TIMEOUT."); |
| 92 | # endif | 94 | # endif |
| 93 | _Static_assert(SPLIT_MAX_CONNECTION_ERRORS > 0, "SPLIT_WATCHDOG_ENABLE requires SPLIT_MAX_CONNECTION_ERRORS be above 0 for a functioning disconnection check."); | 95 | STATIC_ASSERT(SPLIT_MAX_CONNECTION_ERRORS > 0, "SPLIT_WATCHDOG_ENABLE requires SPLIT_MAX_CONNECTION_ERRORS be above 0 for a functioning disconnection check."); |
| 94 | 96 | ||
| 95 | static uint32_t split_watchdog_started = 0; | 97 | static uint32_t split_watchdog_started = 0; |
| 96 | static bool split_watchdog_done = false; | 98 | static bool split_watchdog_done = false; |
