mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 20:48:51 +08:00
Updated copyright headers and removed trailing whitespace
This commit is contained in:
@@ -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 */
|
||||
/** */
|
||||
/** NOR Flash */
|
||||
/** */
|
||||
@@ -34,56 +35,46 @@
|
||||
#include "lx_api.h"
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _lx_nor_flash_partial_defragment PORTABLE C */
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _lx_nor_flash_partial_defragment PORTABLE C */
|
||||
/* 6.1.7 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
/* */
|
||||
/* DESCRIPTION */
|
||||
/* */
|
||||
/* This function defragments the NOR flash up to the specified */
|
||||
/* number of blocks. . */
|
||||
/* */
|
||||
/* INPUT */
|
||||
/* */
|
||||
/* nor_flash NOR flash instance */
|
||||
/* max_blocks Maximum number of blocks to */
|
||||
/* defragment */
|
||||
/* */
|
||||
/* OUTPUT */
|
||||
/* */
|
||||
/* return status */
|
||||
/* */
|
||||
/* CALLS */
|
||||
/* */
|
||||
/* _lx_nor_flash_block_reclaim Reclaim a NOR flash block */
|
||||
/* tx_mutex_get Get thread protection */
|
||||
/* tx_mutex_put Release thread protection */
|
||||
/* */
|
||||
/* CALLED BY */
|
||||
/* */
|
||||
/* Application Code */
|
||||
/* Internal LevelX */
|
||||
/* */
|
||||
/* RELEASE HISTORY */
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 William E. Lamie Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* This function defragments the NOR flash up to the specified */
|
||||
/* number of blocks. . */
|
||||
/* */
|
||||
/* INPUT */
|
||||
/* */
|
||||
/* nor_flash NOR flash instance */
|
||||
/* max_blocks Maximum number of blocks to */
|
||||
/* defragment */
|
||||
/* */
|
||||
/* OUTPUT */
|
||||
/* */
|
||||
/* return status */
|
||||
/* */
|
||||
/* CALLS */
|
||||
/* */
|
||||
/* _lx_nor_flash_block_reclaim Reclaim a NOR flash block */
|
||||
/* tx_mutex_get Get thread protection */
|
||||
/* tx_mutex_put Release thread protection */
|
||||
/* */
|
||||
/* CALLED BY */
|
||||
/* */
|
||||
/* Application Code */
|
||||
/* Internal LevelX */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _lx_nor_flash_partial_defragment(LX_NOR_FLASH *nor_flash, UINT max_blocks)
|
||||
{
|
||||
|
||||
|
||||
ULONG i;
|
||||
|
||||
|
||||
@@ -96,7 +87,7 @@ ULONG i;
|
||||
/* Determine if the maximum number of blocks exceeds the total blocks in this flash instance. */
|
||||
if (max_blocks >= nor_flash -> lx_nor_flash_total_blocks)
|
||||
{
|
||||
|
||||
|
||||
/* Adjust the maximum to the total number of blocks. */
|
||||
max_blocks = nor_flash -> lx_nor_flash_total_blocks;
|
||||
}
|
||||
@@ -104,11 +95,11 @@ ULONG i;
|
||||
/* Loop for max number of blocks, while there are obsolete count. */
|
||||
for (i = 0; i < max_blocks; i++)
|
||||
{
|
||||
|
||||
|
||||
/* Determine if there is any more defragment work. */
|
||||
if (nor_flash -> lx_nor_flash_obsolete_physical_sectors == 0)
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
/* Call the block reclaim function to defragment. */
|
||||
_lx_nor_flash_block_reclaim(nor_flash);
|
||||
}
|
||||
@@ -119,7 +110,7 @@ ULONG i;
|
||||
tx_mutex_put(&nor_flash -> lx_nor_flash_mutex);
|
||||
#endif
|
||||
|
||||
/* Return successful completion. */
|
||||
/* Return successful completion. */
|
||||
return(LX_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user