aboutsummaryrefslogtreecommitdiffstats
path: root/meta-baldeagle/recipes-applications/gpio-test
diff options
context:
space:
mode:
Diffstat (limited to 'meta-baldeagle/recipes-applications/gpio-test')
-rw-r--r--meta-baldeagle/recipes-applications/gpio-test/files/gpio-test.c56
-rw-r--r--meta-baldeagle/recipes-applications/gpio-test/gpio-test_1.0.bb2
2 files changed, 29 insertions, 29 deletions
diff --git a/meta-baldeagle/recipes-applications/gpio-test/files/gpio-test.c b/meta-baldeagle/recipes-applications/gpio-test/files/gpio-test.c
index c12231ea..a36c821a 100644
--- a/meta-baldeagle/recipes-applications/gpio-test/files/gpio-test.c
+++ b/meta-baldeagle/recipes-applications/gpio-test/files/gpio-test.c
@@ -106,7 +106,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;
@@ -514,33 +541,6 @@ out:
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-baldeagle/recipes-applications/gpio-test/gpio-test_1.0.bb b/meta-baldeagle/recipes-applications/gpio-test/gpio-test_1.0.bb
index 6109a2d3..9d061528 100644
--- a/meta-baldeagle/recipes-applications/gpio-test/gpio-test_1.0.bb
+++ b/meta-baldeagle/recipes-applications/gpio-test/gpio-test_1.0.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Sample application for AMD GPIO driver"
SECTION = "applications"
LICENSE = "BSD"
DEPENDS = "readline"
-LIC_FILES_CHKSUM = "file://gpio-test.c;md5=39a7f24d8634a2dcba930899b58b0c5b"
+LIC_FILES_CHKSUM = "file://gpio-test.c;md5=662f6472a0d858aa3ce7d5f0c980647f"
PR = "r1"
PV = "1.0"