fixed leds
This commit is contained in:
parent
77671a4832
commit
88a360b32c
|
@ -71,7 +71,7 @@ extern resource_t
|
||||||
res_event,
|
res_event,
|
||||||
res_sub;
|
res_sub;
|
||||||
#if PLATFORM_HAS_LEDS
|
#if PLATFORM_HAS_LEDS
|
||||||
#include "dev/leds.h"
|
#include "dev/leds-arch.h"
|
||||||
extern resource_t res_leds, res_toggle;
|
extern resource_t res_leds, res_toggle;
|
||||||
#endif
|
#endif
|
||||||
#if PLATFORM_HAS_LIGHT
|
#if PLATFORM_HAS_LIGHT
|
||||||
|
@ -89,11 +89,13 @@ extern resource_t res_radio;
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
hw_init()
|
hw_init()
|
||||||
{
|
{
|
||||||
#if defined (PLATFORM_HAS_LEDS)
|
#if defined (PLATFORM_HAS_LEDS)
|
||||||
leds_off(LEDS_RED);
|
leds_arch_init();
|
||||||
|
LEDS_OFF();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,13 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
#include "rest-engine.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);
|
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,
|
RESOURCE(res_toggle,
|
||||||
"title=\"Red LED\";rt=\"Control\"",
|
"title=\"LED\";rt=\"Control\"",
|
||||||
NULL,
|
NULL,
|
||||||
res_post_handler,
|
res_post_handler,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -58,6 +58,6 @@ RESOURCE(res_toggle,
|
||||||
static void
|
static void
|
||||||
res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
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 */
|
#endif /* PLATFORM_HAS_LEDS */
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
#define LED_GREEN_TOGGLE() LED_OUT ^= BIT_GREEN
|
#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);
|
void leds_arch_init(void);
|
||||||
|
|
Loading…
Reference in a new issue