Skip to content

Commit

Permalink
feat: store the firmware version in the usb spec SERIAL_NUMBER data blob
Browse files Browse the repository at this point in the history
  • Loading branch information
fdidron committed Jul 8, 2024
1 parent d03c020 commit 3e551f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions keyboards/zsa/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#pragma once

#ifdef ORYX_ENABLE
# ifndef FIRMWARE_VERSION
# define FIRMWARE_VERSION u8"default/latest"
# endif // FIRMWARE_VERSION
# ifndef SERIAL_NUMBER
# define SERIAL_NUMBER default/latest
# endif // SERIAL_NUMBER
# ifndef RAW_USAGE_PAGE
# define RAW_USAGE_PAGE 0xFF60
# endif // RAW_USAGE_PAGE
Expand Down
8 changes: 2 additions & 6 deletions keyboards/zsa/common/oryx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include <string.h>
#include "oryx.h"

#ifndef FIRMWARE_VERSION
# define FIRMWARE_VERSION u8"default/latest"
#endif // FIRMWARE_VERSION

rawhid_state_t rawhid_state = {
.paired = false,
.rgb_control = false,
Expand Down Expand Up @@ -110,13 +106,13 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
switch (command) {
case ORYX_CMD_GET_FW_VERSION: {
uint8_t event[RAW_EPSIZE];
uint8_t fw_version_size = sizeof(FIRMWARE_VERSION);
uint8_t fw_version_size = sizeof(SERIAL_NUMBER);
uint8_t stop[1];

event[0] = ORYX_EVT_GET_FW_VERSION;
stop[0] = ORYX_STOP_BIT;

memcpy(event + 1, FIRMWARE_VERSION, fw_version_size);
memcpy(event + 1, SERIAL_NUMBER, fw_version_size);
memcpy(event + fw_version_size, stop, 1);

raw_hid_send_oryx(event, RAW_EPSIZE);
Expand Down

0 comments on commit 3e551f4

Please sign in to comment.