@@ -117,7 +117,6 @@ void nand_read_id(nand_id_t *nand_id)
117
117
{
118
118
uint32_t data = 0 ;
119
119
120
- /* Send Command to the command area */
121
120
* (__IO uint8_t * )(Bank_NAND_ADDR | CMD_AREA ) = fsmc_cmd .read_id_cmd ;
122
121
* (__IO uint8_t * )(Bank_NAND_ADDR | ADDR_AREA ) = 0x00 ;
123
122
@@ -266,7 +265,7 @@ uint32_t nand_read_data(uint8_t *buf, uint32_t page, uint32_t page_offset,
266
265
* (__IO uint8_t * )(Bank_NAND_ADDR | CMD_AREA ) = fsmc_cmd .read2_cmd ;
267
266
268
267
for (i = 0 ; i < data_size ; i ++ )
269
- buf [i ]= * (__IO uint8_t * )(Bank_NAND_ADDR | DATA_AREA );
268
+ buf [i ] = * (__IO uint8_t * )(Bank_NAND_ADDR | DATA_AREA );
270
269
271
270
return nand_get_status ();
272
271
}
@@ -383,29 +382,16 @@ uint32_t nand_erase_block(uint32_t page)
383
382
return nand_get_status ();
384
383
}
385
384
386
- /**
387
- * @brief This routine reset the NAND FLASH.
388
- * @param None
389
- * @retval NAND_READY
390
- */
391
385
uint32_t nand_reset ()
392
386
{
393
387
* (__IO uint8_t * )(Bank_NAND_ADDR | CMD_AREA ) = fsmc_cmd .reset_cmd ;
394
388
395
389
return (NAND_READY );
396
390
}
397
391
398
- /**
399
- * @brief Get the NAND operation status.
400
- * @param None
401
- * @retval New status of the NAND operation. This parameter can be:
402
- * - NAND_TIMEOUT_ERROR: when the previous operation generate
403
- * a Timeout error
404
- * - NAND_READY: when memory is ready for the next operation
405
- */
406
- uint32_t nand_get_status (void )
392
+ uint32_t nand_get_status ()
407
393
{
408
- uint32_t timeout = 0x1000000 , status = NAND_READY ;
394
+ uint32_t status , timeout = 0x1000000 ;
409
395
410
396
status = nand_read_status ();
411
397
@@ -419,29 +405,19 @@ uint32_t nand_get_status(void)
419
405
if (!timeout )
420
406
status = NAND_TIMEOUT_ERROR ;
421
407
422
- /* Return the operation status */
423
- return (status );
408
+ return status ;
424
409
}
425
410
426
- /**
427
- * @brief Reads the NAND memory status using the Read status command.
428
- * @param None
429
- * @retval The status of the NAND memory. This parameter can be:
430
- * - NAND_BUSY: when memory is busy
431
- * - NAND_READY: when memory is ready for the next operation
432
- * - NAND_ERROR: when the previous operation gererates error
433
- */
434
- uint32_t nand_read_status (void )
411
+ uint32_t nand_read_status ()
435
412
{
436
- uint32_t data = 0x00 , status = NAND_BUSY ;
413
+ uint32_t data , status ;
437
414
438
- /* Read status operation */
439
415
* (__IO uint8_t * )(Bank_NAND_ADDR | CMD_AREA ) = fsmc_cmd .status_cmd ;
440
416
data = * (__IO uint8_t * )(Bank_NAND_ADDR );
441
417
442
418
if ((data & NAND_ERROR ) == NAND_ERROR )
443
419
status = NAND_ERROR ;
444
- else if ((data & NAND_READY ) == NAND_READY )
420
+ else if ((data & NAND_READY ) == NAND_READY )
445
421
status = NAND_READY ;
446
422
else
447
423
status = NAND_BUSY ;
0 commit comments