Start moving code out of webusb and to Oryx feature
This commit is contained in:
committed by
Florian Didron
parent
d3f23ecfbc
commit
e41ab50016
30
quantum/oryx.c
Normal file
30
quantum/oryx.c
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user