Skip to content

Commit 589bbc6

Browse files
committed
make OWL Exporter more like Daisy Exporter
1 parent 9edb3e8 commit 589bbc6

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

Source/Heavy/DaisyExporter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ class DaisyExporter final : public ExporterBase {
360360
bool heavyExitCode = getExitCode();
361361

362362
if (compile) {
363-
364363
auto bin = Toolchain::dir.getChildFile("bin");
365364
auto libDaisy = Toolchain::dir.getChildFile("lib").getChildFile("libdaisy");
366365
auto make = bin.getChildFile("make" + exeSuffix);

Source/Heavy/OWLExporter.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,28 +123,29 @@ class OWLExporter : public ExporterBase {
123123
if (shouldQuit)
124124
return true;
125125

126+
// Delay to get correct exit code
127+
Time::waitForMillisecondCounter(Time::getMillisecondCounter() + 300);
128+
126129
auto outputFile = File(outdir);
127130
auto sourceDir = outputFile.getChildFile("Source");
128131

129132
bool heavyExitCode = getExitCode();
130133

131-
outputFile.getChildFile("ir").deleteRecursively();
132-
outputFile.getChildFile("hv").deleteRecursively();
133-
outputFile.getChildFile("c").deleteRecursively();
134-
135-
auto OWL = Toolchain::dir.getChildFile("lib").getChildFile("OwlProgram");
136-
OWL.copyDirectoryTo(outputFile.getChildFile("OwlProgram"));
137-
138-
// Delay to get correct exit code
139-
Time::waitForMillisecondCounter(Time::getMillisecondCounter() + 300);
140-
141134
if (compile) {
142135
auto workingDir = File::getCurrentWorkingDirectory();
143136

144137
auto bin = Toolchain::dir.getChildFile("bin");
138+
auto OWL = Toolchain::dir.getChildFile("lib").getChildFile("OwlProgram");
145139
auto make = bin.getChildFile("make" + exeSuffix);
146140
auto compiler = bin.getChildFile("arm-none-eabi-gcc" + exeSuffix);
147141

142+
OWL.copyDirectoryTo(outputFile.getChildFile("OwlProgram"));
143+
144+
outputFile.getChildFile("ir").deleteRecursively();
145+
outputFile.getChildFile("hv").deleteRecursively();
146+
outputFile.getChildFile("c").deleteRecursively();
147+
148+
// Run from within OwlProgram directory
148149
auto OwlDir = outputFile.getChildFile("OwlProgram");
149150
OwlDir.setAsCurrentWorkingDirectory();
150151
OwlDir.getChildFile("Tools/FirmwareSender" + exeSuffix).setExecutePermission(1);
@@ -218,6 +219,9 @@ class OWLExporter : public ExporterBase {
218219
} else {
219220
auto outputFile = File(outdir);
220221

222+
auto OWL = Toolchain::dir.getChildFile("lib").getChildFile("OwlProgram");
223+
OWL.copyDirectoryTo(outputFile.getChildFile("OwlProgram"));
224+
221225
outputFile.getChildFile("ir").deleteRecursively();
222226
outputFile.getChildFile("hv").deleteRecursively();
223227
outputFile.getChildFile("c").deleteRecursively();

0 commit comments

Comments
 (0)