Skip to content

Commit

Permalink
nrf/drivers: Add support for using flash block device with SoftDevice.
Browse files Browse the repository at this point in the history
Update flash.c to also be compiled in when
MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE is enabled and SoftDevice is
present.

Update bluetooth/ble_drv.c to forward flash events to flash.c when
MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE is enabled.
  • Loading branch information
glennrub authored and dpgeorge committed Aug 8, 2021
1 parent 127cec8 commit 5a873e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/nrf/drivers/bluetooth/ble_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void ble_drv_discover_descriptors(void) {

static void sd_evt_handler(uint32_t evt_id) {
switch (evt_id) {
#if MICROPY_MBFS
#if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE || MICROPY_MBFS
case NRF_EVT_FLASH_OPERATION_SUCCESS:
flash_operation_finished(FLASH_STATE_SUCCESS);
break;
Expand Down
4 changes: 2 additions & 2 deletions ports/nrf/drivers/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "py/mpconfig.h"

#if MICROPY_MBFS && BLUETOOTH_SD
#if (MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE || MICROPY_MBFS) && BLUETOOTH_SD

#include "drivers/flash.h"
#include "drivers/bluetooth/ble_drv.h"
Expand Down Expand Up @@ -129,4 +129,4 @@ void flash_write_bytes(uint32_t dst, const uint8_t *src, uint32_t num_bytes) {
}
}

#endif // MICROPY_MBFS
#endif // (MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE || MICROPY_MBFS) && BLUETOOTH_SD

0 comments on commit 5a873e2

Please sign in to comment.