summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tmk_core/common/webusb.c8
-rw-r--r--tmk_core/common/webusb.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/tmk_core/common/webusb.c b/tmk_core/common/webusb.c
index 47507bab55..f269ed58be 100644
--- a/tmk_core/common/webusb.c
+++ b/tmk_core/common/webusb.c
@@ -20,9 +20,9 @@ void webusb_receive(uint8_t *data, uint8_t length) {
return;
}
- if(command == WEBUSB_GET_LANDING_PAGE) {
+ if(command == WEBUSB_GET_FW_VERSION) {
// Landing page + packet headers(2) + stop bit(1)
- uint8_t lp_size = sizeof(WEBUSB_LANDING_PAGE_URL) + 3;
+ uint8_t lp_size = sizeof(FIRMWARE_VERSION) + 3;
uint8_t url[lp_size];
uint8_t event[2];
@@ -33,8 +33,8 @@ void webusb_receive(uint8_t *data, uint8_t length) {
stop[0] = WEBUSB_STOP_BIT;
memcpy(url, event, 2);
- memcpy(url + 2, WEBUSB_LANDING_PAGE_URL, sizeof(WEBUSB_LANDING_PAGE_URL));
- memcpy(url + 2 + sizeof(WEBUSB_LANDING_PAGE_URL), stop, 1);
+ memcpy(url + 2, FIRMWARE_VERSION, sizeof(FIRMWARE_VERSION));
+ memcpy(url + 2 + sizeof(FIRMWARE_VERSION), stop, 1);
webusb_send(url, lp_size);
return;
}
diff --git a/tmk_core/common/webusb.h b/tmk_core/common/webusb.h
index 873ecb7ce2..7696db677d 100644
--- a/tmk_core/common/webusb.h
+++ b/tmk_core/common/webusb.h
@@ -3,6 +3,9 @@
#include <stdint.h>
#include <stdbool.h>
+#ifndef FIRMWARE_VERSION
+#define FIRMWARE_VERSION u8"default"
+#endif
#define WEBUSB_STOP_BIT -2
#define WEBUSB_BLINK_STEPS 512
#define WEBUSB_BLINK_END WEBUSB_BLINK_STEPS * 60
@@ -27,7 +30,7 @@ enum Webusb_Status_Code {
enum Webusb_Command_Code {
WEBUSB_CMD_PAIR,
- WEBUSB_GET_LANDING_PAGE
+ WEBUSB_GET_FW_VERSION
};
enum Webusb_Event_Code {