From 88a360b32c2f9d116fbe726b484004836c763806 Mon Sep 17 00:00:00 2001 From: Marcus Priesch Date: Sun, 30 Jul 2017 00:19:07 +0200 Subject: [PATCH] fixed leds --- examples/osd/merkurboard/er-example-server.c | 6 ++++-- examples/osd/merkurboard/resources/res-toggle.c | 8 ++++---- platform/osd-merkur-256/dev/leds-arch.h | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/osd/merkurboard/er-example-server.c b/examples/osd/merkurboard/er-example-server.c index 01686bcd4..124ca456e 100644 --- a/examples/osd/merkurboard/er-example-server.c +++ b/examples/osd/merkurboard/er-example-server.c @@ -71,7 +71,7 @@ extern resource_t res_event, res_sub; #if PLATFORM_HAS_LEDS -#include "dev/leds.h" +#include "dev/leds-arch.h" extern resource_t res_leds, res_toggle; #endif #if PLATFORM_HAS_LIGHT @@ -89,11 +89,13 @@ extern resource_t res_radio; #endif */ + void hw_init() { #if defined (PLATFORM_HAS_LEDS) - leds_off(LEDS_RED); +leds_arch_init(); +LEDS_OFF(); #endif } diff --git a/examples/osd/merkurboard/resources/res-toggle.c b/examples/osd/merkurboard/resources/res-toggle.c index d8a773306..dd64161f1 100644 --- a/examples/osd/merkurboard/resources/res-toggle.c +++ b/examples/osd/merkurboard/resources/res-toggle.c @@ -43,13 +43,13 @@ #include #include "contiki.h" #include "rest-engine.h" -#include "dev/leds.h" +#include "dev/leds-arch.h" static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset); -/* A simple actuator example. Toggles the red led */ +/* A simple actuator example. Toggles the led */ RESOURCE(res_toggle, - "title=\"Red LED\";rt=\"Control\"", + "title=\"LED\";rt=\"Control\"", NULL, res_post_handler, NULL, @@ -58,6 +58,6 @@ RESOURCE(res_toggle, static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset) { - leds_toggle(LEDS_RED); + LED_GREEN_TOGGLE (); } #endif /* PLATFORM_HAS_LEDS */ diff --git a/platform/osd-merkur-256/dev/leds-arch.h b/platform/osd-merkur-256/dev/leds-arch.h index 97c5ede06..237a4e71d 100644 --- a/platform/osd-merkur-256/dev/leds-arch.h +++ b/platform/osd-merkur-256/dev/leds-arch.h @@ -14,8 +14,8 @@ #define LED_GREEN_TOGGLE() LED_OUT ^= BIT_GREEN -#define LEDS_OFF() LED_OUT &= ~BIT_GREEN -#define LEDS_ON() LED_OUT |= BIT_GREEN +#define LEDS_ON() LED_OUT &= ~BIT_GREEN +#define LEDS_OFF() LED_OUT |= BIT_GREEN void leds_arch_init(void);