aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-applications
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amdfalconx86/recipes-applications')
-rw-r--r--meta-amdfalconx86/recipes-applications/gpio-test/files/gpio-test.c56
-rw-r--r--meta-amdfalconx86/recipes-applications/gpio-test/gpio-test_1.0.bb2
-rw-r--r--meta-amdfalconx86/recipes-applications/spi-test/files/spirom-test.c10
-rw-r--r--meta-amdfalconx86/recipes-applications/spi-test/spi-test_1.0.bb2
4 files changed, 35 insertions, 35 deletions
diff --git a/meta-amdfalconx86/recipes-applications/gpio-test/files/gpio-test.c b/meta-amdfalconx86/recipes-applications/gpio-test/files/gpio-test.c
index 6cd073bd..41a16765 100644
--- a/meta-amdfalconx86/recipes-applications/gpio-test/files/gpio-test.c
+++ b/meta-amdfalconx86/recipes-applications/gpio-test/files/gpio-test.c
@@ -109,7 +109,34 @@ void parse_cmd(const char *cmdline)
{
int fd;
- if (strncmp(cmdline, "help", 4) == 0)
+ if ((cmdline == NULL) || (strncmp(cmdline, "exit", 4) == 0)) {
+ int i;
+ int ret;
+ char gpio[3 + 1];
+
+ printf("\nExiting...\n");
+
+ /* We need to unexport all the GPIO pins exported earlier */
+ for (i = 0; i < AMD_GPIO_NUM_PINS; i++) {
+ if (gpio_in_use[i]) {
+ int fd;
+
+ fd = open("/sys/class/gpio/unexport", O_WRONLY);
+ if (fd < 0) {
+ printf("\nPlease make sure AMD GPIO driver is loaded\n");
+ exit(EXIT_FAILURE);
+ }
+ memset(gpio, '\0', (3 + 1));
+ snprintf(gpio, 4, "%d", i);
+
+ ret = write(fd, gpio, strlen(gpio));
+ if (ret < 0)
+ perror("Error writing to /sys/class/gpio/unexport");
+ }
+ }
+
+ exit(EXIT_SUCCESS);
+ } else if (strncmp(cmdline, "help", 4) == 0)
print_usage();
else if (strncmp(cmdline, "getnumgpio", 10) == 0) {
int fd;
@@ -470,33 +497,6 @@ void parse_cmd(const char *cmdline)
perror("Error executing \'dmesg | grep GPIO\'");
} else if (strncmp(cmdline, "license", 7) == 0) {
show_license();
- } else if (strncmp(cmdline, "exit", 4) == 0) {
- int i;
- int ret;
- char gpio[3 + 1];
-
- printf("\nExiting...\n");
-
- /* We need to unexport all the GPIO pins exported earlier */
- for (i = 0; i < AMD_GPIO_NUM_PINS; i++) {
- if (gpio_in_use[i]) {
- int fd;
-
- fd = open("/sys/class/gpio/unexport", O_WRONLY);
- if (fd < 0) {
- printf("\nPlease make sure AMD GPIO driver is loaded\n");
- exit(EXIT_FAILURE);
- }
- memset(gpio, '\0', (3 + 1));
- snprintf(gpio, 4, "%d", i);
-
- ret = write(fd, gpio, strlen(gpio));
- if (ret < 0)
- perror("Error writing to /sys/class/gpio/unexport");
- }
- }
-
- exit(EXIT_SUCCESS);
} else {
printf("\nUnknown command\n");
print_usage();
diff --git a/meta-amdfalconx86/recipes-applications/gpio-test/gpio-test_1.0.bb b/meta-amdfalconx86/recipes-applications/gpio-test/gpio-test_1.0.bb
index f3f3e2e3..9b1c1f5a 100644
--- a/meta-amdfalconx86/recipes-applications/gpio-test/gpio-test_1.0.bb
+++ b/meta-amdfalconx86/recipes-applications/gpio-test/gpio-test_1.0.bb
@@ -3,7 +3,7 @@ SECTION = "applications"
LICENSE = "BSD"
DEPENDS = "readline"
LIC_FILES_CHKSUM = "\
- file://gpio-test.c;md5=e6e905de01cc60d7d588d095010cc904 \
+ file://gpio-test.c;md5=35bd4f849bf7b97ea60ecf724ff7d228 \
file://gpio-test.h;md5=c7aaa743b172cf584032f9bfc5e85044 \
"
diff --git a/meta-amdfalconx86/recipes-applications/spi-test/files/spirom-test.c b/meta-amdfalconx86/recipes-applications/spi-test/files/spirom-test.c
index 22c90036..d1eb4b5c 100644
--- a/meta-amdfalconx86/recipes-applications/spi-test/files/spirom-test.c
+++ b/meta-amdfalconx86/recipes-applications/spi-test/files/spirom-test.c
@@ -125,7 +125,11 @@ void parse_cmd(const char *cmdline)
int addr;
int ret;
- if (strncmp(cmdline, "enumerate", 9) == 0) {
+ if ((cmdline == NULL) || (strncmp(cmdline, "exit", 4) == 0)) {
+ printf("\nExiting...\n");
+ close(fd);
+ exit(EXIT_SUCCESS);
+ } else if (strncmp(cmdline, "enumerate", 9) == 0) {
DIR *dir;
struct dirent *dir_entry;
int device_found = 0;
@@ -758,10 +762,6 @@ void parse_cmd(const char *cmdline)
close(infile_fd);
} else if (strncmp(cmdline, "license", 7) == 0) {
show_license();
- } else if (strncmp(cmdline, "exit", 4) == 0) {
- printf("\nExiting...\n");
- close(fd);
- exit(EXIT_SUCCESS);
} else if (strncmp(cmdline, "help", 4) == 0) {
print_usage();
} else {
diff --git a/meta-amdfalconx86/recipes-applications/spi-test/spi-test_1.0.bb b/meta-amdfalconx86/recipes-applications/spi-test/spi-test_1.0.bb
index 8824d55f..f83aa820 100644
--- a/meta-amdfalconx86/recipes-applications/spi-test/spi-test_1.0.bb
+++ b/meta-amdfalconx86/recipes-applications/spi-test/spi-test_1.0.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Sample application for AMD SPI driver"
SECTION = "applications"
LICENSE = "BSD"
DEPENDS = "readline"
-LIC_FILES_CHKSUM = "file://spirom-test.c;md5=73fa56dd9cc632c765154aa1c2f5b228 \
+LIC_FILES_CHKSUM = "file://spirom-test.c;md5=8dac97fc0527a3c7721fc257dd110445 \
file://spirom.h;md5=1990f1f1e7a82115c354152bed83df52 \
"