소스 검색

chore: move device configuration into "define" macro

Sanghee Park 1 년 전
부모
커밋
9abb109aab
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/scenes/mtp/mtp.c
  2. 4 0
      src/scenes/mtp/mtp.h

+ 2 - 2
src/scenes/mtp/mtp.c

@@ -1086,11 +1086,11 @@ int BuildDeviceInfo(uint8_t* buffer) {
     ptr += length;
 
     // Device version
-    WriteMTPString(ptr, "1.0", &length);
+    WriteMTPString(ptr, MTP_DEVICE_VERSION, &length);
     ptr += length;
 
     // Serial number
-    WriteMTPString(ptr, "HakureiReimu", &length);
+    WriteMTPString(ptr, MTP_DEVICE_SERIAL, &length);
     ptr += length;
 
     return ptr - buffer;

+ 4 - 0
src/scenes/mtp/mtp.h

@@ -1,5 +1,9 @@
 #pragma once
 
+// MTP Device Serial
+#define MTP_DEVICE_SERIAL "HakureiReimu"
+#define MTP_DEVICE_VERISON "1.0"
+
 #define MTP_STANDARD_VERSION 100
 #define MTP_VENDOR_EXTENSION_ID 0x6
 #define MTP_VENDOR_EXTENSION_VERSION 100