fixed leds
This commit is contained in:
parent
181e2c436e
commit
1384aad51a
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@
|
|||
#include <string.h>
|
||||
#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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue