diff options
Diffstat (limited to 'quantum/split_common')
| -rw-r--r-- | quantum/split_common/split_util.c | 8 | ||||
| -rw-r--r-- | quantum/split_common/transaction_id_define.h | 4 | ||||
| -rw-r--r-- | quantum/split_common/transport.c | 3 |
3 files changed, 10 insertions, 5 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; |
diff --git a/quantum/split_common/transaction_id_define.h b/quantum/split_common/transaction_id_define.h index 5bfbe2aec7..694737868a 100644 --- a/quantum/split_common/transaction_id_define.h +++ b/quantum/split_common/transaction_id_define.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | #pragma once | 17 | #pragma once |
| 18 | 18 | ||
| 19 | #include "compiler_support.h" | ||
| 20 | |||
| 19 | enum serial_transaction_id { | 21 | enum serial_transaction_id { |
| 20 | #ifdef USE_I2C | 22 | #ifdef USE_I2C |
| 21 | I2C_EXECUTE_CALLBACK, | 23 | I2C_EXECUTE_CALLBACK, |
| @@ -122,4 +124,4 @@ enum serial_transaction_id { | |||
| 122 | }; | 124 | }; |
| 123 | 125 | ||
| 124 | // Ensure we only use 5 bits for transaction | 126 | // Ensure we only use 5 bits for transaction |
| 125 | _Static_assert(NUM_TOTAL_TRANSACTIONS <= (1 << 5), "Max number of usable transactions exceeded"); | 127 | STATIC_ASSERT(NUM_TOTAL_TRANSACTIONS <= (1 << 5), "Max number of usable transactions exceeded"); |
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 83edc34859..ea687af1c2 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <string.h> | 17 | #include <string.h> |
| 18 | #include <debug.h> | 18 | #include <debug.h> |
| 19 | 19 | ||
| 20 | #include "compiler_support.h" | ||
| 20 | #include "transactions.h" | 21 | #include "transactions.h" |
| 21 | #include "transport.h" | 22 | #include "transport.h" |
| 22 | #include "transaction_id_define.h" | 23 | #include "transaction_id_define.h" |
| @@ -36,7 +37,7 @@ | |||
| 36 | # include "i2c_slave.h" | 37 | # include "i2c_slave.h" |
| 37 | 38 | ||
| 38 | // Ensure the I2C buffer has enough space | 39 | // Ensure the I2C buffer has enough space |
| 39 | _Static_assert(sizeof(split_shared_memory_t) <= I2C_SLAVE_REG_COUNT, "split_shared_memory_t too large for I2C_SLAVE_REG_COUNT"); | 40 | STATIC_ASSERT(sizeof(split_shared_memory_t) <= I2C_SLAVE_REG_COUNT, "split_shared_memory_t too large for I2C_SLAVE_REG_COUNT"); |
| 40 | 41 | ||
| 41 | split_shared_memory_t *const split_shmem = (split_shared_memory_t *)i2c_slave_reg; | 42 | split_shared_memory_t *const split_shmem = (split_shared_memory_t *)i2c_slave_reg; |
| 42 | 43 | ||
