Browse code

Add source code of the uROM generator

Pawel Jablonski authored on 24/01/2021 21:45:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+/*
2
+ * Author: Pawel Jablonski
3
+ * E-mail: pj@xirx.net
4
+ * WWW: xirx.net
5
+ * GIT: git.xirx.net
6
+ *
7
+ * License: You can use this code however you like
8
+ * but leave information about the original author.
9
+ * Code is free for non-commercial and commercial use.
10
+ */
11
+
12
+#include <QCoreApplication>
13
+#include <QTextStream>
14
+
15
+#include "urom.h"
16
+
17
+static QString const UROM0_PATH = "urom0.bin"; //!< Path to the first microcode output file
18
+static QString const UROM1_PATH = "urom1.bin"; //!< Path to the second microcode output file
19
+
20
+//! Main entry function of the application
21
+int main(int, char **)
22
+{
23
+	QTextStream out(stdout);
24
+
25
+	// Create and generate the microcode
26
+	URom uRom = URom();
27
+
28
+	// Try to save the data to the output files
29
+	if(!uRom.saveFiles(UROM0_PATH, UROM1_PATH))
30
+	{
31
+		// If failed show the error message
32
+		out << "ERROR: Failed to save uROM data\n";
33
+
34
+		// Return the error code
35
+		return(-1);
36
+	}
37
+
38
+	// The data files were saved. Show the success message
39
+	out << "OK: uROM data has been saved successfully\n";
40
+
41
+	// Return the success code
42
+	return(0);
43
+}