Updated copyright headers and removed trailing whitespace

This commit is contained in:
Frédéric Desbiens
2026-03-05 09:17:20 +01:00
parent fa1a8e5ff4
commit b9ba4a97bf
71 changed files with 3124 additions and 3739 deletions
+48 -53
View File
@@ -1,18 +1,19 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** LevelX Component */
/** */
/** LevelX Component */
/** */
/** NAND Flash */
/** */
@@ -34,60 +35,54 @@
#include "lx_api.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _lx_nand_flash_sector_write PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _lx_nand_flash_sector_write PORTABLE C */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Xiuwen Cai, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function writes a logical sector to the NAND flash page. */
/* */
/* INPUT */
/* */
/* nand_flash NAND flash instance */
/* logical_sector Logical sector number */
/* buffer Pointer to buffer to write */
/* (the size is number of */
/* bytes in a page) */
/* */
/* OUTPUT */
/* */
/* return status */
/* */
/* CALLS */
/* */
/* _lx_nand_flash_block_find Find the mapped block */
/* _lx_nand_flash_block_allocate Allocate block */
/* DESCRIPTION */
/* */
/* This function writes a logical sector to the NAND flash page. */
/* */
/* INPUT */
/* */
/* nand_flash NAND flash instance */
/* logical_sector Logical sector number */
/* buffer Pointer to buffer to write */
/* (the size is number of */
/* bytes in a page) */
/* */
/* OUTPUT */
/* */
/* return status */
/* */
/* CALLS */
/* */
/* _lx_nand_flash_block_find Find the mapped block */
/* _lx_nand_flash_block_allocate Allocate block */
/* _lx_nand_flash_mapped_block_list_remove */
/* Remove mapped block */
/* _lx_nand_flash_data_page_copy Copy data pages */
/* Remove mapped block */
/* _lx_nand_flash_data_page_copy Copy data pages */
/* _lx_nand_flash_free_block_list_add Add free block to list */
/* _lx_nand_flash_block_mapping_set Set block mapping */
/* lx_nand_flash_driver_pages_write Write pages */
/* _lx_nand_flash_block_status_set Set block status */
/* _lx_nand_flash_driver_block_erase Erase block */
/* _lx_nand_flash_block_mapping_set Set block mapping */
/* lx_nand_flash_driver_pages_write Write pages */
/* _lx_nand_flash_block_status_set Set block status */
/* _lx_nand_flash_driver_block_erase Erase block */
/* _lx_nand_flash_erase_count_set Set erase count */
/* _lx_nand_flash_block_data_move Move block data */
/* _lx_nand_flash_mapped_block_list_add Add mapped block to list */
/* _lx_nand_flash_system_error Internal system error handler */
/* tx_mutex_get Get thread protection */
/* tx_mutex_put Release thread protection */
/* */
/* CALLED BY */
/* */
/* Application Code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* _lx_nand_flash_system_error Internal system error handler */
/* tx_mutex_get Get thread protection */
/* tx_mutex_put Release thread protection */
/* */
/* 03-08-2023 Xiuwen Cai Initial Version 6.2.1 */
/* CALLED BY */
/* */
/* Application Code */
/* */
/**************************************************************************/
UINT _lx_nand_flash_sector_write(LX_NAND_FLASH *nand_flash, ULONG logical_sector, VOID *buffer)
@@ -114,7 +109,7 @@ UINT copy_block = LX_FALSE;
/* See if we can find the logical sector in the current mapping. */
status = _lx_nand_flash_block_find(nand_flash, logical_sector, &block, &block_status);
/* Check return status. */
if(status != LX_SUCCESS)
{
@@ -195,7 +190,7 @@ UINT copy_block = LX_FALSE;
new_block = block;
new_block_status = block_status;
}
/* Check if copy block flag is set. */
if (copy_block)
{
@@ -222,7 +217,7 @@ UINT copy_block = LX_FALSE;
return(LX_ERROR);
}
}
/* Check if update mapping flag is set. */
if (update_mapping)
{
@@ -236,7 +231,7 @@ UINT copy_block = LX_FALSE;
/* Set spare buffer to all 0xFF bytes. */
LX_MEMSET(spare_buffer_ptr, 0xFF, nand_flash -> lx_nand_flash_spare_total_length);
/* Check if there is enough spare data for metadata block number. */
if (nand_flash -> lx_nand_flash_spare_data2_length >= sizeof(USHORT))
{
@@ -247,7 +242,7 @@ UINT copy_block = LX_FALSE;
/* Set page type and sector address. */
LX_UTILITY_LONG_SET(&spare_buffer_ptr[nand_flash -> lx_nand_flash_spare_data1_offset], LX_NAND_PAGE_TYPE_USER_DATA | logical_sector);
/* Get page to write. */
page = new_block_status & LX_NAND_BLOCK_STATUS_PAGE_NUMBER_MASK;