Merge branch 'master' into develop

This commit is contained in:
hathach 2019-09-25 12:14:38 +07:00
commit ef4d0e7564
4 changed files with 21 additions and 2 deletions

View File

@ -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 nRF52832](https://www.adafruit.com/product/3406)
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) - [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
- Adafruit Metro nRF52840 Express - Adafruit Metro nRF52840 Express
- [Electronut Labs Papyr](https://docs.electronut.in/papyr/) - [Electronut Labs Papyr](https://docs.electronut.in/papyr/)
- MakerDiary MDK nRF52840 USB Dongle - MakerDiary MDK nRF52840 USB Dongle

View File

@ -1,5 +1,12 @@
# Adafruit nRF52 Bootloader Changelog # 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 ## 0.2.11
- Fixed various FAT issues, thanks to @henrygab - Fixed various FAT issues, thanks to @henrygab

View File

@ -42,12 +42,16 @@
//------------- IMPLEMENTATION -------------// //------------- IMPLEMENTATION -------------//
void button_init(uint32_t pin) 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) 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) void board_init(void)

View File

@ -38,6 +38,13 @@
#ifndef BUTTON_FRESET #ifndef BUTTON_FRESET
#define BUTTON_FRESET BUTTON_2 #define BUTTON_FRESET BUTTON_2
#endif #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. // The primary LED is usually Red but not in all cases.
#define LED_PRIMARY 0 #define LED_PRIMARY 0