Skip to content

Commit

Permalink
boards/yunjia-nrf: cleaned up LED handling
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Feb 18, 2016
1 parent 146ebc2 commit 48f4e64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion boards/yunjia-nrf51822/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
void board_init(void)
{
/* setup led(s) for debugging */
NRF_GPIO->PIN_CNF[LED_RED_PIN] = GPIO_PIN_CNF_DIR_Output;
NRF_GPIO->DIRSET = (LED_RED_MASK);

/* initialize the CPU */
cpu_init();
Expand Down
9 changes: 5 additions & 4 deletions boards/yunjia-nrf51822/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED_RED_PIN 8
#define LED_RED_PIN (GPIO_PIN(0, 8))
#define LED_RED_MASK (1 << 8)

#define LED_RED_ON (NRF_GPIO->OUTSET = (1 << LED_RED_PIN))
#define LED_RED_OFF (NRF_GPIO->OUTCLR = (1 << LED_RED_PIN))
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= (1 << LED_RED_PIN))
#define LED_RED_ON (NRF_GPIO->OUTSET = LED_RED_MASK)
#define LED_RED_OFF (NRF_GPIO->OUTCLR = LED_RED_MASK)
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= LED_RED_MASK)
#define LED_GREEN_ON /* not available */
#define LED_GREEN_OFF /* not available */
#define LED_GREEN_TOGGLE /* not available */
Expand Down

0 comments on commit 48f4e64

Please sign in to comment.