forked from kofal.net/zmk
chore: clang-format the codebase.
* Use the LLVM style * Override indent width (8) and column limit (100) * Fixes #142.
This commit is contained in:
@@ -12,27 +12,24 @@
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
int zmk_endpoints_send_report(u8_t usage_page)
|
||||
{
|
||||
int zmk_endpoints_send_report(u8_t usage_page) {
|
||||
int err;
|
||||
struct zmk_hid_keypad_report *keypad_report;
|
||||
struct zmk_hid_consumer_report *consumer_report;
|
||||
LOG_DBG("usage page 0x%02X", usage_page);
|
||||
switch (usage_page)
|
||||
{
|
||||
switch (usage_page) {
|
||||
case USAGE_KEYPAD:
|
||||
keypad_report = zmk_hid_get_keypad_report();
|
||||
#ifdef CONFIG_ZMK_USB
|
||||
if (zmk_usb_hid_send_report((u8_t *)keypad_report, sizeof(struct zmk_hid_keypad_report)) != 0)
|
||||
{
|
||||
if (zmk_usb_hid_send_report((u8_t *)keypad_report, sizeof(struct zmk_hid_keypad_report)) !=
|
||||
0) {
|
||||
LOG_DBG("USB Send Failed");
|
||||
}
|
||||
#endif /* CONFIG_ZMK_USB */
|
||||
|
||||
#ifdef CONFIG_ZMK_BLE
|
||||
err = zmk_hog_send_keypad_report(&keypad_report->body);
|
||||
if (err)
|
||||
{
|
||||
if (err) {
|
||||
LOG_ERR("FAILED TO SEND OVER HOG: %d", err);
|
||||
}
|
||||
#endif /* CONFIG_ZMK_BLE */
|
||||
@@ -41,16 +38,15 @@ int zmk_endpoints_send_report(u8_t usage_page)
|
||||
case USAGE_CONSUMER:
|
||||
consumer_report = zmk_hid_get_consumer_report();
|
||||
#ifdef CONFIG_ZMK_USB
|
||||
if (zmk_usb_hid_send_report((u8_t *)consumer_report, sizeof(struct zmk_hid_consumer_report)) != 0)
|
||||
{
|
||||
if (zmk_usb_hid_send_report((u8_t *)consumer_report,
|
||||
sizeof(struct zmk_hid_consumer_report)) != 0) {
|
||||
LOG_DBG("USB Send Failed");
|
||||
}
|
||||
#endif /* CONFIG_ZMK_USB */
|
||||
|
||||
#ifdef CONFIG_ZMK_BLE
|
||||
err = zmk_hog_send_consumer_report(&consumer_report->body);
|
||||
if (err)
|
||||
{
|
||||
if (err) {
|
||||
LOG_ERR("FAILED TO SEND OVER HOG: %d", err);
|
||||
}
|
||||
#endif /* CONFIG_ZMK_BLE */
|
||||
@@ -63,4 +59,3 @@ int zmk_endpoints_send_report(u8_t usage_page)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user