Permalink
Browse files

Merge branch 'master' of https://github.com/Benjamin-Dobell/Heimdall

  • Loading branch information...
2 parents 07cfd5f + e0e84b2 commit 3c1695d1e12a01096bbffcf3ede627862b9c5ed6 @nka11 committed Jan 18, 2013
View
@@ -6,5 +6,4 @@ GeneratedFiles/
*.vcxproj.user
*.suo
*.sdf
-heimdall-frontend/Qt4VSPropertySheet.props
*.opensdf
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets" />
+ <PropertyGroup />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup>
+ <BuildMacro Include="QTDIR">
+ <Value>$(QTDIR)</Value>
+ <EnvironmentVariable>true</EnvironmentVariable>
+ </BuildMacro>
+ </ItemGroup>
+</Project>
@@ -1078,6 +1078,9 @@ void MainWindow::DetectDevice(void)
QStringList arguments;
arguments.append("detect");
+ if (verboseOutput)
+ arguments.append("--verbose");
+
arguments.append("--stdout-errors");
StartHeimdall(arguments);
@@ -1093,6 +1096,9 @@ void MainWindow::ClosePcScreen(void)
QStringList arguments;
arguments.append("close-pc-screen");
+ if (verboseOutput)
+ arguments.append("--verbose");
+
arguments.append("--stdout-errors");
StartHeimdall(arguments);
@@ -1129,6 +1135,9 @@ void MainWindow::DownloadPit(void)
arguments.append("--no-reboot");
+ if (verboseOutput)
+ arguments.append("--verbose");
+
arguments.append("--stdout-errors");
StartHeimdall(arguments);
@@ -1188,6 +1197,9 @@ void MainWindow::PrintPit(void)
arguments.append("--stdout-errors");
arguments.append("--no-reboot");
+ if (verboseOutput)
+ arguments.append("--verbose");
+
StartHeimdall(arguments);
}
@@ -1,3 +1,3 @@
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6601", MODE="0666"
-SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="685D", MODE="0666"
-SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="68C3", MODE="0666"
+SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="685d", MODE="0666"
+SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="68c3", MODE="0666"
@@ -444,21 +444,32 @@ static PitData *getPitData(const map<string, FILE *>& argumentFileMap, BridgeMan
FILE *localPitFile = localPitFileIt->second;
// Load the local pit file into memory.
- unsigned char *pitFileBuffer = new unsigned char[4096];
- memset(pitFileBuffer, 0, 4096);
-
fseek(localPitFile, 0, SEEK_END);
long localPitFileSize = ftell(localPitFile);
rewind(localPitFile);
+ unsigned char *pitFileBuffer = new unsigned char[localPitFileSize];
+ memset(pitFileBuffer, 0, localPitFileSize);
+
// dataRead is discarded, it's here to remove warnings.
int dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile);
- rewind(localPitFile);
- localPitData = new PitData();
- localPitData->Unpack(pitFileBuffer);
+ if (dataRead > 0)
+ {
+ rewind(localPitFile);
- delete [] pitFileBuffer;
+ localPitData = new PitData();
+ localPitData->Unpack(pitFileBuffer);
+
+ delete [] pitFileBuffer;
+ }
+ else
+ {
+ Interface::PrintError("Failed to read PIT file.\n");
+
+ delete [] pitFileBuffer;
+ return (nullptr);
+ }
}
if (repartition)
@@ -503,7 +514,7 @@ int FlashAction::Execute(int argc, char **argv)
map<string, ArgumentType> argumentTypes;
- argumentTypes["repartition"] = kArgumentTypeString;
+ argumentTypes["repartition"] = kArgumentTypeFlag;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;

0 comments on commit 3c1695d

Please sign in to comment.