diff options
author | Drashna Jael're <drashna@live.com> | 2020-01-14 16:30:29 -0800 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2020-02-26 10:15:12 +0900 |
commit | e41ab50016345f7813d250772457a1463e0cd973 (patch) | |
tree | 229011a7ba2d273643bf6245241f642b7ba3bda0 /quantum/oryx.c | |
parent | d3f23ecfbcd2a69714422ab68f346e51fcc2a6de (diff) |
Start moving code out of webusb and to Oryx feature
Diffstat (limited to 'quantum/oryx.c')
-rw-r--r-- | quantum/oryx.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/quantum/oryx.c b/quantum/oryx.c new file mode 100644 index 0000000000..93ee50e935 --- /dev/null +++ b/quantum/oryx.c @@ -0,0 +1,30 @@ +#include "oryx.h" + +bool webusb_state_live_training_enabled; + +bool webusb_receive_oryx(uint8_t *data, uint8_t length) { + uint8_t command = data[0]; + + switch (command) { + case ORYX_GET_LAYER: + oryx_layer_event(); + return true; break; + + } + + return false; +} + + +void oryx_layer_event(void) { + uint8_t layer; + uint8_t event[4]; + layer = get_highest_layer(layer_state); +#ifdef WEBUSB_ENABLE + event[0] = WEBUSB_STATUS_OK; + event[1] = ORYX_EVT_LAYER; + event[2] = layer; + event[3] = WEBUSB_STOP_BIT; + webusb_send(event, sizeof(event)); +#endif +} |