diff --git a/README.md b/README.md index 24e8f50..df5fe65 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ echo "dtoverlay=dwc2" >> /boot/config.txt echo "dtoverlay=gpio-poweroff,gpiopin=5,active_low" >> /boot/config.txt +sed -i /boot/config.txt -e "s/^hdmi_force_hotplug=1$/hdmi_force_hotplug=1$/" + echo "libcomposite" >> /etc/modules apt purge plymouth diff --git a/raspberry-environment/display.py b/raspberry-environment/display.py index 8932704..e457221 100644 --- a/raspberry-environment/display.py +++ b/raspberry-environment/display.py @@ -214,12 +214,14 @@ if __name__ == '__main__': #os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/compatible_id", "RNDIS") #os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id", "5162001") -# subprocess.run(['tvservice', '-p'], shell=False, check=False) -# subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '16'], shell=False, check=False) + fallback_str = b'state 0x12000a [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive\n' + p = subprocess.Popen(['tvservice', '-s'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + _stdout, _stderr = p.communicate() + if (len(_stdout) > 0 and _stdout == fallback_str): + subprocess.run(['tvservice', '--explicit="CEA 16 HDMI"'], shell=False, check=False) + subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '16'], shell=False, check=False) + subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '32'], shell=False, check=False) -#tvservice -p -# tvservice -e "DMT 82" -# fbset -g 1920 1080 1920 1080 16 def callback(paths): # if paths: diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index 49bd256..3f4bd51 100755 Binary files a/windows-snapshot-tool/bin/freeze.exe and b/windows-snapshot-tool/bin/freeze.exe differ diff --git a/windows-snapshot-tool/src/main.cpp b/windows-snapshot-tool/src/main.cpp index 7645e83..21bc0a7 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -274,8 +274,8 @@ void doScreenshot() CaptureImage(Hwnd, L"screenshot.png"); } else { WCHAR filename[128]; - wcsncpy(filename, path, sizeof(filename)); - wcsncpy(filename, L"screenshot.png", sizeof(filename)); + wcsncpy(filename, path, _countof(filename)-1); + wcsncat(filename, L"screenshot.png", _countof(filename) - wcslen(filename) -1); CaptureImage(Hwnd, filename); } @@ -321,7 +321,7 @@ void getRaspiStorage(LPWSTR out) { if (GetVolumeInformationW(drive, volumeName, ARRAYSIZE(volumeName), &serialNumber, &maxComponentLen, &fileSystemFlags, fileSystemName, ARRAYSIZE(fileSystemName))) { if (wcscmp(L"SCREENSHOTS", volumeName)==0) { // ToDo - wcsncpy(out, drive, sizeof(out)); + wcsncpy(out, drive, 10); // ToDo } } }