File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
targets/TARGET_NORDIC/TARGET_NRF5_SDK13 Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 38
38
39
39
#include "flash_api.h"
40
40
#include "nrf_nvmc.h"
41
+ #include "nrf_soc.h"
42
+ #include "nrf_sdm.h"
41
43
42
44
#if DEVICE_FLASH
43
45
46
+ /*
47
+ uint8_t sd_enabled;
48
+ if ((sd_softdevice_is_enabled(&sd_enabled) == NRF_SUCCESS) && sd_enabled == 1)
49
+ {
50
+ return -1;
51
+ }
52
+ */
53
+
44
54
int32_t flash_init (flash_t * obj )
45
55
{
46
56
(void )(obj );
57
+ uint8_t sd_enabled ;
58
+ if ((sd_softdevice_is_enabled (& sd_enabled ) == NRF_SUCCESS ) && sd_enabled == 1 )
59
+ {
60
+ return -1 ;
61
+ }
47
62
return 0 ;
48
63
}
49
64
@@ -56,12 +71,22 @@ int32_t flash_free(flash_t *obj)
56
71
int32_t flash_erase_sector (flash_t * obj , uint32_t address )
57
72
{
58
73
(void )(obj );
74
+ uint8_t sd_enabled ;
75
+ if ((sd_softdevice_is_enabled (& sd_enabled ) == NRF_SUCCESS ) && sd_enabled == 1 )
76
+ {
77
+ return -1 ;
78
+ }
59
79
nrf_nvmc_page_erase (address );
60
80
return 0 ;
61
81
}
62
82
63
83
int32_t flash_program_page (flash_t * obj , uint32_t address , const uint8_t * data , uint32_t size )
64
84
{
85
+ uint8_t sd_enabled ;
86
+ if ((sd_softdevice_is_enabled (& sd_enabled ) == NRF_SUCCESS ) && sd_enabled == 1 )
87
+ {
88
+ return -1 ;
89
+ }
65
90
/* We will use *_words function to speed up flashing code. Word means 32bit -> 4B
66
91
* or sizeof(uint32_t). */
67
92
nrf_nvmc_write_words (address , data , (size / sizeof (uint32_t )));
You can’t perform that action at this time.
0 commit comments