Skip to content

Commit df4ecd8

Browse files
committed
Update on 30 Nov 2023. Expand to see details.
dd0abfd Fix sequential checking logic 6d0382a Add configuration checks
1 parent cef8e4f commit df4ecd8

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

common/inc/lx_api.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* lx_api.h PORTABLE C */
29-
/* 6.3.0 */
29+
/* 6.x */
3030
/* AUTHOR */
3131
/* */
3232
/* William E. Lamie, Microsoft Corporation */
@@ -86,6 +86,9 @@
8686
/* bitmap and obsolete count */
8787
/* cache for NOR flash, */
8888
/* resulting in version 6.3.0 */
89+
/* xx-xx-xxxx Xiuwen Cai Modified comment(s), */
90+
/* added configuration checks, */
91+
/* resulting in version 6.x */
8992
/* */
9093
/**************************************************************************/
9194

@@ -279,6 +282,19 @@ typedef unsigned long long ULONG64;
279282
#define LX_NOR_PHYSICAL_SECTOR_FREE 0xFFFFFFFF
280283

281284

285+
/* Check extended cache configurations. */
286+
#ifdef LX_NOR_DISABLE_EXTENDED_CACHE
287+
288+
#ifdef LX_NOR_ENABLE_MAPPING_BITMAP
289+
#error "To enable mapping bitmap, you need to undefine LX_NOR_DISABLE_EXTENDED_CACHE."
290+
#endif
291+
292+
#ifdef LX_NOR_ENABLE_OBSOLETE_COUNT_CACHE
293+
#error "To enable obsolete count cache, you need to undefine LX_NOR_DISABLE_EXTENDED_CACHE."
294+
#endif
295+
296+
#endif
297+
282298
/* Define NAND flash constants. */
283299

284300
#define LX_NAND_GOOD_BLOCK 0xFF

common/src/lx_nand_flash_data_page_copy.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/* FUNCTION RELEASE */
4141
/* */
4242
/* _lx_nand_flash_data_page_copy PORTABLE C */
43-
/* 6.2.1 */
43+
/* 6.x */
4444
/* AUTHOR */
4545
/* */
4646
/* Xiuwen Cai, Microsoft Corporation */
@@ -78,7 +78,11 @@
7878
/* */
7979
/* DATE NAME DESCRIPTION */
8080
/* */
81-
/* 03-08-2023 Xiuwen Cai Initial Version 6.2.1 */
81+
/* 03-08-2023 Xiuwen Cai Initial Version 6.2.1 */
82+
/* xx-xx-xxxx Xiuwen Cai Modified comment(s), */
83+
/* fixed sequential checking */
84+
/* logic, */
85+
/* resulting in version 6.x */
8286
/* */
8387
/**************************************************************************/
8488
UINT _lx_nand_flash_data_page_copy(LX_NAND_FLASH* nand_flash, ULONG logical_sector, ULONG source_block, USHORT src_block_status,
@@ -168,7 +172,7 @@ ULONG number_of_pages;
168172
}
169173

170174
/* Check if the pages in destination block is still sequential. */
171-
if ((destination_page) != (logical_sector + i % nand_flash -> lx_nand_flash_pages_per_block))
175+
if (destination_page != ((logical_sector + i) % nand_flash -> lx_nand_flash_pages_per_block))
172176
{
173177
/* Mark the block status as non sequential. */
174178
dest_block_status |= LX_NAND_BLOCK_STATUS_NON_SEQUENTIAL;

0 commit comments

Comments
 (0)