summaryrefslogtreecommitdiff
path: root/cleopatre/application
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application')
-rw-r--r--cleopatre/application/managerd/inc/gpio_event.h6
-rw-r--r--cleopatre/application/managerd/src/gpio_event.c21
2 files changed, 11 insertions, 16 deletions
diff --git a/cleopatre/application/managerd/inc/gpio_event.h b/cleopatre/application/managerd/inc/gpio_event.h
index 2840088098..3d332fbbae 100644
--- a/cleopatre/application/managerd/inc/gpio_event.h
+++ b/cleopatre/application/managerd/inc/gpio_event.h
@@ -21,8 +21,6 @@
#ifndef GPIO_EVENT_H
#define GPIO_EVENT_H
-#include "../../linux/autoconf.h"
-
struct managerd_ctx;
/** GPIO number for SC button and it associated LED */
@@ -30,10 +28,6 @@ struct managerd_ctx;
/** LED GPIO numbers */
#define LED_ATTACHMENT_GPIO_NUM 3
-#if (defined CONFIG_MACH_SPK300G || defined CONFIG_MACH_SPK300 || defined CONFIG_MACH_SPK310)
-# define LED1_GPIO_NUM 13
-# define LED2_GPIO_NUM 12
-#endif
/** Blinking timers */
#define LED_FAST_TIMER_US 100000
diff --git a/cleopatre/application/managerd/src/gpio_event.c b/cleopatre/application/managerd/src/gpio_event.c
index b81dcc5b79..11a9178149 100644
--- a/cleopatre/application/managerd/src/gpio_event.c
+++ b/cleopatre/application/managerd/src/gpio_event.c
@@ -33,6 +33,7 @@
#include "../../linux/gpio.h"
#include "managerd.h"
+#include "managerd_config.h"
#include "gpio_event.h"
/* Global variable for "/dev/gpio" file descriptor
@@ -298,9 +299,9 @@ led1_event (struct managerd_ctx *ctx, const char *cco)
assert (NULL != ctx);
assert (NULL != cco);
-#if (defined CONFIG_MACH_SPK300G || defined CONFIG_MACH_SPK300)
+#if defined (CONFIG_EXTRA_LEDS)
/* Set GPIO number */
- ctx->led_gpio.gpioval.num = LED1_GPIO_NUM;
+ ctx->led_gpio.gpioval.num = CONFIG_LED1_GPIO_NUM;
if (!strcmp (LIBSPID_HPAV_INFO_VALUE_CCO_STATION, cco)
|| !strcmp (LIBSPID_HPAV_INFO_VALUE_CCO_PROXY, cco))
@@ -351,9 +352,9 @@ led2_event (struct managerd_ctx *ctx, libspid_boolean_t is_backup_cco)
/* Check arguments */
assert (NULL != ctx);
-#if (defined CONFIG_MACH_SPK300G || defined CONFIG_MACH_SPK300)
+#if defined (CONFIG_EXTRA_LEDS)
/* Set GPIO number */
- ctx->led_gpio.gpioval.num = LED2_GPIO_NUM;
+ ctx->led_gpio.gpioval.num = CONFIG_LED2_GPIO_NUM;
if (LIBSPID_FALSE == is_backup_cco)
{
@@ -414,16 +415,16 @@ led_init (struct managerd_ctx *ctx)
strerror (errno));
}
-#if (defined CONFIG_MACH_SPK300G || defined CONFIG_MACH_SPK300)
+#if defined (CONFIG_EXTRA_LEDS)
/* Set GPIO direction of LED1&2 */
- ctx->led_gpio.gpiodir.num = LED1_GPIO_NUM;
+ ctx->led_gpio.gpiodir.num = CONFIG_LED1_GPIO_NUM;
if (0 > (ioctl (ctx->gpio_fd, GPIOIOC_SETDIRECTION,
(unsigned long *) &ctx->led_gpio)))
{
syslog (LOG_WARNING, "cannot call ioctl SETDIRECTION for LED1 GPIO (%s)",
strerror (errno));
}
- ctx->led_gpio.gpiodir.num = LED2_GPIO_NUM;
+ ctx->led_gpio.gpiodir.num = CONFIG_LED2_GPIO_NUM;
if (0 > (ioctl (ctx->gpio_fd, GPIOIOC_SETDIRECTION,
(unsigned long *) &ctx->led_gpio)))
{
@@ -466,16 +467,16 @@ led_uninit (struct managerd_ctx *ctx)
strerror (errno));
}
-#if (defined CONFIG_MACH_SPK300G || defined CONFIG_MACH_SPK300)
+#if defined (CONFIG_EXTRA_LEDS)
/* Reset GPIO value of LED1&2 */
- ctx->led_gpio.gpioval.num = LED1_GPIO_NUM;
+ ctx->led_gpio.gpioval.num = CONFIG_LED1_GPIO_NUM;
if (0 > (ioctl (ctx->gpio_fd, GPIOIOC_SETVALUE,
(unsigned long *) &ctx->led_gpio)))
{
syslog (LOG_WARNING, "cannot call ioctl SETVALUE for LED1 GPIO (%s)",
strerror (errno));
}
- ctx->led_gpio.gpioval.num = LED2_GPIO_NUM;
+ ctx->led_gpio.gpioval.num = CONFIG_LED2_GPIO_NUM;
if (0 > (ioctl (ctx->gpio_fd, GPIOIOC_SETVALUE,
(unsigned long *) &ctx->led_gpio)))
{