File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ typedef struct
158
158
uint8_t * rx_buf ;
159
159
uint32_t addr ;
160
160
uint32_t len ;
161
- int addr_is_valid ;
161
+ int addr_is_set ;
162
162
np_page_t page ;
163
163
uint32_t bytes_written ;
164
164
uint32_t bytes_ack ;
@@ -370,7 +370,7 @@ static int np_cmd_nand_write_start(np_prog_t *prog)
370
370
371
371
prog -> addr = addr ;
372
372
prog -> len = len ;
373
- prog -> addr_is_valid = 1 ;
373
+ prog -> addr_is_set = 1 ;
374
374
375
375
prog -> page .page = addr / prog -> chip_info -> page_size ;
376
376
prog -> page .offset = 0 ;
@@ -447,7 +447,7 @@ static int np_cmd_nand_write_data(np_prog_t *prog)
447
447
return NP_ERR_CMD_DATA_SIZE ;
448
448
}
449
449
450
- if (!prog -> addr_is_valid )
450
+ if (!prog -> addr_is_set )
451
451
{
452
452
ERROR_PRINT ("Write address is not set\r\n" );
453
453
return NP_ERR_ADDR_INVALID ;
@@ -506,15 +506,16 @@ static int np_cmd_nand_write_data(np_prog_t *prog)
506
506
507
507
static int np_cmd_nand_write_end (np_prog_t * prog )
508
508
{
509
- if (prog -> page .offset )
510
- goto Error ;
509
+ prog -> addr_is_set = 0 ;
511
510
512
- prog -> addr_is_valid = 0 ;
511
+ if (prog -> page .offset )
512
+ {
513
+ ERROR_PRINT ("Data of 0x%lx length was not written\r\n" ,
514
+ prog -> page .offset );
515
+ return NP_ERR_NAND_WR ;
516
+ }
513
517
514
518
return np_send_ok_status ();
515
-
516
- Error :
517
- return NP_ERR_NAND_WR ;
518
519
}
519
520
520
521
static int np_cmd_nand_write (np_prog_t * prog )
You can’t perform that action at this time.
0 commit comments