@@ -128,7 +128,7 @@ int flash_ext_stream_read(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *da
128
128
__flash_ext_turnon ();
129
129
130
130
SpicWaitWipDoneRefinedRtl8195A (flashobj .SpicInitPara );
131
-
131
+
132
132
offset = addr & 0x03 ;
133
133
addr = addr & ~0x03 ;
134
134
pbuf = data ;
@@ -189,13 +189,13 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
189
189
uint32_t i , offset , word ;
190
190
const uint8_t * pbuf ;
191
191
uint8_t * ptr ;
192
- u8 flashtype = 0 ;
192
+ u8 flashtype = 0 ;
193
193
194
194
offset = addr & 0x03 ;
195
195
addr = addr & ~0x03 ;
196
196
pbuf = data ;
197
197
flashtype = flashobj .SpicInitPara .flashtype ;
198
-
198
+
199
199
if (offset != 0 ) {
200
200
word = HAL_READ32 (SPI_FLASH_BASE , addr );
201
201
ptr = (uint8_t * )& word + offset ;
@@ -207,7 +207,7 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
207
207
}
208
208
HAL_WRITE32 (SPI_FLASH_BASE , addr , word );
209
209
SpicWaitBusyDoneRtl8195A ();
210
-
210
+
211
211
if (flashtype == FLASH_MICRON ){
212
212
SpicWaitOperationDoneRtl8195A (flashobj .SpicInitPara );
213
213
} else {
@@ -222,7 +222,7 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
222
222
((uint32_t )(* (pbuf + 2 )) << 16 ) | ((uint32_t )(* (pbuf + 3 )) << 24 );
223
223
HAL_WRITE32 (SPI_FLASH_BASE , addr , word );
224
224
SpicWaitBusyDoneRtl8195A ();
225
-
225
+
226
226
if (flashtype == FLASH_MICRON ){
227
227
SpicWaitOperationDoneRtl8195A (flashobj .SpicInitPara );
228
228
} else {
@@ -237,7 +237,7 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
237
237
while (len >= 4 ) {
238
238
HAL_WRITE32 (SPI_FLASH_BASE , addr , (uint32_t )* ((uint32_t * )pbuf ));
239
239
SpicWaitBusyDoneRtl8195A ();
240
-
240
+
241
241
if (flashtype == FLASH_MICRON ){
242
242
SpicWaitOperationDoneRtl8195A (flashobj .SpicInitPara );
243
243
} else {
@@ -260,7 +260,7 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
260
260
261
261
HAL_WRITE32 (SPI_FLASH_BASE , addr , word );
262
262
SpicWaitBusyDoneRtl8195A ();
263
-
263
+
264
264
if (flashtype == FLASH_MICRON ){
265
265
SpicWaitOperationDoneRtl8195A (flashobj .SpicInitPara );
266
266
} else {
@@ -271,7 +271,7 @@ int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const ui
271
271
return 0 ;
272
272
}
273
273
274
- int flash_ext_stream_write (flash_t * obj , uint32_t addr , uint32_t len , uint8_t * data )
274
+ int flash_ext_stream_write (flash_t * obj , uint32_t addr , uint32_t len , const uint8_t * data )
275
275
{
276
276
int32_t status ;
277
277
@@ -287,7 +287,7 @@ int flash_stream_read(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *data)
287
287
return flash_ext_stream_read (obj , addr , len , data );
288
288
}
289
289
290
- int flash_stream_write (flash_t * obj , uint32_t addr , uint32_t len , uint8_t * data )
290
+ int flash_stream_write (flash_t * obj , uint32_t addr , uint32_t len , const uint8_t * data )
291
291
{
292
292
return flash_ext_stream_write (obj , addr , len , data );
293
293
}
@@ -308,7 +308,7 @@ Users can use either of functions depending on their needs.
308
308
*/
309
309
310
310
int flash_ext_burst_write (flash_t * obj , uint32_t address ,uint32_t length , uint8_t * data )
311
- {
311
+ {
312
312
u32 OccuSize ;
313
313
u32 ProgramSize ;
314
314
u32 PageSize ;
@@ -340,7 +340,7 @@ int flash_ext_burst_write(flash_t *obj, uint32_t address ,uint32_t length, uint8
340
340
}
341
341
342
342
address += ProgramSize ;
343
- data += ProgramSize ;
343
+ data += ProgramSize ;
344
344
length -= ProgramSize ;
345
345
OccuSize = 0 ;
346
346
} else {
@@ -435,7 +435,7 @@ This function aims to reset the status register, please make sure the operation
435
435
void flash_ext_reset_status (flash_t * obj )
436
436
{
437
437
__flash_ext_turnon ();
438
- SpicSetFlashStatusRefinedRtl8195A (0 , flashobj .SpicInitPara );
438
+ SpicSetFlashStatusRefinedRtl8195A (0 , flashobj .SpicInitPara );
439
439
SpicWaitWipDoneRefinedRtl8195A (flashobj .SpicInitPara );
440
440
__flash_ext_turnoff ();
441
441
}
0 commit comments