diff --git a/csdk/tools/legacy/mag160c_demo.c b/csdk/tools/legacy/mag160c_demo.c index a8a60d5..2716093 100644 --- a/csdk/tools/legacy/mag160c_demo.c +++ b/csdk/tools/legacy/mag160c_demo.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -340,7 +341,16 @@ static int init_camera(void) { int WINAPI WinMain(HINSTANCE inst, HINSTANCE hprev, LPSTR cmd, int show) { (void)hprev; (void)cmd; (void)show; - g_log = fopen("%TEMP%/opencode/demo_log.txt", "w"); + /* Log/snapshot under %TEMP%, resolved at runtime (the original archived + version hard-coded a per-machine absolute path that breaks elsewhere). */ + static char logpath[MAX_PATH], bmppath[MAX_PATH]; + const char *tmp = getenv("TEMP"); + if (!tmp || !*tmp) tmp = "."; + snprintf(logpath, sizeof(logpath) - 1, "%s\\mag160c_demo_log.txt", tmp); + logpath[sizeof(logpath) - 1] = 0; + snprintf(bmppath, sizeof(bmppath) - 1, "%s\\mag160c_render_test.bmp", tmp); + bmppath[sizeof(bmppath) - 1] = 0; + g_log = fopen(logpath, "w"); if (g_log) { fprintf(g_log, "demo start\n"); fflush(g_log); } libusb_init(&g_usb); @@ -468,7 +478,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE hprev, LPSTR cmd, int show) { } render(g_frame); if ((g_frame_count % 200) == 0) { - FILE *tf = fopen("%TEMP%/opencode/render_test.bmp", "wb"); + FILE *tf = fopen(bmppath, "wb"); if (tf) { fwrite(g_bmp, 1, sizeof(g_bmp), tf); fclose(tf); } } DWORD now = GetTickCount(); diff --git a/csdk/tools/legacy/mag160c_demo_usb0.c b/csdk/tools/legacy/mag160c_demo_usb0.c index b5172af..2c5565f 100644 --- a/csdk/tools/legacy/mag160c_demo_usb0.c +++ b/csdk/tools/legacy/mag160c_demo_usb0.c @@ -10,6 +10,7 @@ #include #include #include +#include /* ---- libusb-win32 (libusb0) API ---------------------------------------- */ typedef struct usb_bus { @@ -319,7 +320,12 @@ static int init_camera(void) { int WINAPI WinMain(HINSTANCE inst, HINSTANCE hprev, LPSTR cmd, int show) { (void)hprev; (void)cmd; (void)show; - g_log = fopen("%TEMP%/opencode/demo_usb0_log.txt", "w"); + static char logpath[MAX_PATH]; + const char *tmp = getenv("TEMP"); + if (!tmp || !*tmp) tmp = "."; + snprintf(logpath, sizeof(logpath) - 1, "%s\\mag160c_demo_usb0_log.txt", tmp); + logpath[sizeof(logpath) - 1] = 0; + g_log = fopen(logpath, "w"); if (g_log) { fprintf(g_log, "demo start\n"); fflush(g_log); } HMODULE l0 = LoadLibraryA("libusb0.dll"); diff --git a/tools/resume_android.ps1 b/tools/resume_android.ps1 index bfbc31d..73b836c 100644 --- a/tools/resume_android.ps1 +++ b/tools/resume_android.ps1 @@ -9,7 +9,15 @@ Write-Host "Gradle: 工程wrapper android\gradlew.bat (JDK 21: C:\Tools\jdk-21)" Write-Host "SDK: $(Test-Path "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe")" Write-Host "=== 2. 设备 ===" -adb devices +# adb: PATH first, then the known SDK install locations +$adb = Get-Command adb -ErrorAction SilentlyContinue +if (-not $adb) { + foreach ($cand in @("C:\Tools\android-sdk\platform-tools\adb.exe", + "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe")) { + if (Test-Path $cand) { $adb = $cand; break } + } +} +if ($adb) { & $adb devices } else { Write-Host "!!! adb 未找到(确认 Android SDK platform-tools 已安装)" } Write-Host "=== 3. 构建 ===" Push-Location $andr diff --git a/tools/resume_rev.ps1 b/tools/resume_rev.ps1 index 13a9c22..d31e602 100644 --- a/tools/resume_rev.ps1 +++ b/tools/resume_rev.ps1 @@ -56,6 +56,12 @@ if (-not (Test-Path "$pairsDir\pair_000.raw")) { } else { Write-Host "官方数据已存在, 跳过" } Write-Host "=== 8. 对比 ===" -python "%TEMP%\compare_live.py" +# compare_live.py was an ad-hoc analysis helper of the original session and is +# not shipped with the repo (临时分析脚本不入库); the step is skipped gracefully. +if (Test-Path "$env:TEMP\compare_live.py") { + python "$env:TEMP\compare_live.py" +} else { + Write-Host "跳过: %TEMP%\compare_live.py 不存在(一次性分析脚本,重新生成后再跑)" +} Write-Host "=== 完成。下一步见 analysis\session_state.md ==="