Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nka11 committed Jan 18, 2013
2 parents 07cfd5f + e0e84b2 commit 3c1695d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ GeneratedFiles/
*.vcxproj.user
*.suo
*.sdf
heimdall-frontend/Qt4VSPropertySheet.props
*.opensdf
13 changes: 13 additions & 0 deletions heimdall-frontend/Qt4VSPropertySheet.props
Original file line number Diff line number Diff line change
@@ -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>
12 changes: 12 additions & 0 deletions heimdall-frontend/Source/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,9 @@ void MainWindow::DetectDevice(void)
QStringList arguments;
arguments.append("detect");

if (verboseOutput)
arguments.append("--verbose");

arguments.append("--stdout-errors");

StartHeimdall(arguments);
Expand All @@ -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);
Expand Down Expand Up @@ -1129,6 +1135,9 @@ void MainWindow::DownloadPit(void)

arguments.append("--no-reboot");

if (verboseOutput)
arguments.append("--verbose");

arguments.append("--stdout-errors");

StartHeimdall(arguments);
Expand Down Expand Up @@ -1188,6 +1197,9 @@ void MainWindow::PrintPit(void)
arguments.append("--stdout-errors");
arguments.append("--no-reboot");

if (verboseOutput)
arguments.append("--verbose");

StartHeimdall(arguments);
}

Expand Down
4 changes: 2 additions & 2 deletions heimdall/60-heimdall-galaxy-s.rules
Original file line number Diff line number Diff line change
@@ -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"
27 changes: 19 additions & 8 deletions heimdall/source/FlashAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3c1695d

Please sign in to comment.