refactor: replace macros with constexpr/consts (#4791)

This commit is contained in:
David Lane
2026-02-28 18:22:33 -05:00
committed by GitHub
parent 80103a5d91
commit 2b7af2119d
12 changed files with 74 additions and 76 deletions
+15 -15
View File
@@ -34,21 +34,21 @@ extern "C" {
#include "thread_safe.h"
#include "utility.h"
#define IDX_START_A 0
#define IDX_START_B 1
#define IDX_INVALIDATE_REF_FRAMES 2
#define IDX_LOSS_STATS 3
#define IDX_INPUT_DATA 5
#define IDX_RUMBLE_DATA 6
#define IDX_TERMINATION 7
#define IDX_PERIODIC_PING 8
#define IDX_REQUEST_IDR_FRAME 9
#define IDX_ENCRYPTED 10
#define IDX_HDR_MODE 11
#define IDX_RUMBLE_TRIGGER_DATA 12
#define IDX_SET_MOTION_EVENT 13
#define IDX_SET_RGB_LED 14
#define IDX_SET_ADAPTIVE_TRIGGERS 15
constexpr int IDX_START_A = 0;
constexpr int IDX_START_B = 1;
constexpr int IDX_INVALIDATE_REF_FRAMES = 2;
constexpr int IDX_LOSS_STATS = 3;
constexpr int IDX_INPUT_DATA = 5;
constexpr int IDX_RUMBLE_DATA = 6;
constexpr int IDX_TERMINATION = 7;
constexpr int IDX_PERIODIC_PING = 8;
constexpr int IDX_REQUEST_IDR_FRAME = 9;
constexpr int IDX_ENCRYPTED = 10;
constexpr int IDX_HDR_MODE = 11;
constexpr int IDX_RUMBLE_TRIGGER_DATA = 12;
constexpr int IDX_SET_MOTION_EVENT = 13;
constexpr int IDX_SET_RGB_LED = 14;
constexpr int IDX_SET_ADAPTIVE_TRIGGERS = 15;
static const short packetTypes[] = {
0x0305, // Start A