From c751975f1d889b92405282c2f6c8a8e3569ff840 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 22 Aug 2019 21:57:53 +0700 Subject: [PATCH 1/2] update changelog and readme, ready to relase 0.2.12 --- README.md | 1 + changelog.md | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 32f83da..f5ff865 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ This is a CDC/DFU/UF2 bootloader for nRF52 boards. - [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406) - [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) +- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333) - Adafruit Metro nRF52840 Express - [Electronut Labs Papyr](https://docs.electronut.in/papyr/) - MakerDiary MDK nRF52840 USB Dongle diff --git a/changelog.md b/changelog.md index 3e7680b..94b2938 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Adafruit nRF52 Bootloader Changelog +## 0.2.12 - 2019.08.22 + +- Fixed block alignment bug also in dfu_sd_image_validate (single & dual banks), PR #71 thanks to @fanoush +- Added new board: Adafruit Circuit Playground Bluefruit +- Added new board: Adafruit ItsyBitsy nRF52840 Express (WIP) +- Fixed bug in __DOSTIME__ macro, PR #75 thanks to @henrygab + ## 0.2.11 - Fixed various FAT issues, thanks to @henrygab From 8906b2a8bd0c10efec7beac4846e8a3653eca08b Mon Sep 17 00:00:00 2001 From: Kreg Hanning Date: Mon, 9 Sep 2019 08:59:31 -0400 Subject: [PATCH 2/2] Add check for button direction --- src/boards.c | 8 ++++++-- src/boards.h | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/boards.c b/src/boards.c index e1993aa..c33e94f 100644 --- a/src/boards.c +++ b/src/boards.c @@ -42,12 +42,16 @@ //------------- IMPLEMENTATION -------------// void button_init(uint32_t pin) { - nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); + if (BUTTON_PULL == NRF_GPIO_PIN_PULLDOWN) { + nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_HIGH); + } else { + nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); + } } bool button_pressed(uint32_t pin) { - return (nrf_gpio_pin_read(pin) == 0) ? true : false; + return (nrf_gpio_pin_read(pin) == BUTTON_DIR) ? true : false; } void board_init(void) diff --git a/src/boards.h b/src/boards.h index cd1760b..48db99c 100644 --- a/src/boards.h +++ b/src/boards.h @@ -38,6 +38,13 @@ #ifndef BUTTON_FRESET #define BUTTON_FRESET BUTTON_2 #endif +#ifndef BUTTON_DIR +#if BUTTON_PULL == NRF_GPIO_PIN_PULLDOWN + #define BUTTON_DIR 1 +#elif BUTTON_PULL == NRF_GPIO_PIN_PULLUP + #define BUTTON_DIR 0 +#endif +#endif // The primary LED is usually Red but not in all cases. #define LED_PRIMARY 0