GCC Code Coverage Report


Directory: common/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 5 / 0 / 5
Functions: 100.0% 1 / 0 / 1
Branches: -% 0 / 0 / 0

lx_nand_flash_driver_block_status_get.c
Line Branch Exec Source
1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 * Copyright (c) 2026-present Eclipse ThreadX contributors
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the MIT License which is available at
7 * https://opensource.org/licenses/MIT.
8 *
9 * SPDX-License-Identifier: MIT
10 **************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** LevelX Component */
17 /** */
18 /** NAND Flash */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define LX_SOURCE_CODE
24
25
26 /* Disable ThreadX error checking. */
27
28 #ifndef LX_DISABLE_ERROR_CHECKING
29 #define LX_DISABLE_ERROR_CHECKING
30 #endif
31
32
33 /* Include necessary system files. */
34
35 #include "lx_api.h"
36
37
38 /**************************************************************************/
39 /* */
40 /* FUNCTION RELEASE */
41 /* */
42 /* _lx_nand_flash_driver_block_status_get PORTABLE C */
43 /* 6.2.1 */
44 /* AUTHOR */
45 /* */
46 /* William E. Lamie, Microsoft Corporation */
47 /* */
48 /* DESCRIPTION */
49 /* */
50 /* This function calls the driver to get the block status and */
51 /* updates the internal cache. */
52 /* */
53 /* INPUT */
54 /* */
55 /* nand_flash NAND flash instance */
56 /* block Block number */
57 /* bad_block_flag Pointer to Bad block flag */
58 /* */
59 /* OUTPUT */
60 /* */
61 /* Completion Status */
62 /* */
63 /* CALLS */
64 /* */
65 /* (lx_nand_flash_driver_block_status_get) */
66 /* NAND flash block status get */
67 /* */
68 /* CALLED BY */
69 /* */
70 /* Internal LevelX */
71 /* */
72 /**************************************************************************/
73 41010 UINT _lx_nand_flash_driver_block_status_get(LX_NAND_FLASH *nand_flash, ULONG block, UCHAR *bad_block_flag)
74 {
75
76 UINT status;
77
78
79 /* Increment the block status get count. */
80 41010 nand_flash -> lx_nand_flash_diagnostic_block_status_gets++;
81
82 /* Call driver block status get function. */
83 #ifdef LX_NAND_ENABLE_CONTROL_BLOCK_FOR_DRIVER_INTERFACE
84 4101 status = (nand_flash -> lx_nand_flash_driver_block_status_get)(nand_flash, block, bad_block_flag);
85 #else
86 36909 status = (nand_flash -> lx_nand_flash_driver_block_status_get)(block, bad_block_flag);
87 #endif
88
89 /* Return status. */
90 41010 return(status);
91 }
92
93
94