Skip to content

Commit

Permalink
Bootloader triggers white LED when active
Browse files Browse the repository at this point in the history
  • Loading branch information
lolsborn committed May 15, 2024
1 parent 2083ecb commit 72ff5f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 };
#define BLE_HANDLE_MAX 0xFFFF /**< Max handle value is BLE. */

// limit of 8 chars
#define DEVICE_NAME "AdaDFU" /**< Name of device. Will be included in the advertising data. */
#define DEVICE_NAME "CNRYOTA" /**< Name of device. Will be included in the advertising data. */

#define MIN_CONN_INTERVAL (uint16_t)(MSEC_TO_UNITS(10, UNIT_1_25_MS)) /**< Minimum acceptable connection interval (11.25 milliseconds). */
#define MAX_CONN_INTERVAL (uint16_t)(MSEC_TO_UNITS(30, UNIT_1_25_MS)) /**< Maximum acceptable connection interval (15 milliseconds). */
Expand Down
4 changes: 2 additions & 2 deletions src/boards/canary/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
/*------------------------------------------------------------------*/
/* LED
*------------------------------------------------------------------*/
#define LEDS_NUMBER 2
#define LEDS_NUMBER 3
#define LED_PRIMARY_PIN _PINNUM(1, 1) // Blue
#define LED_SECONDARY_PIN _PINNUM(1, 3) // Green
#define LED_SECONDARY_PIN _PINNUM(1, 3) // Red
#define LED_STATE_ON 0

/*------------------------------------------------------------------*/
Expand Down
9 changes: 9 additions & 0 deletions src/boards/canary/pinconfig.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "boards.h"
#include "uf2/configkeys.h"

#define LED_THREE_PIN _PINNUM(0, 14) // White

__attribute__((used, section(".bootloaderConfig")))
const uint32_t bootloaderConfig[] =
{
Expand All @@ -17,3 +19,10 @@ const uint32_t bootloaderConfig[] =
0, 0, 0, 0, 0, 0, 0, 0
/* CF2 END */
};

void board_init2(void)
{
// Set the LED pins as output
nrf_gpio_cfg_output(LED_THREE_PIN);
nrf_gpio_pin_write(LED_THREE_PIN, LED_STATE_ON);
}

0 comments on commit 72ff5f6

Please sign in to comment.