GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: lx_nor_flash_open.c Lines: 4 4 100.0 %
Date: 2026-03-06 18:45:40 Branches: 0 0 - %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 * Portion Copyright (c) 2025 STMicroelectronics
5
 *
6
 * This program and the accompanying materials are made available under the
7
 * terms of the MIT License which is available at
8
 * https://opensource.org/licenses/MIT.
9
 *
10
 * SPDX-License-Identifier: MIT
11
 **************************************************************************/
12
13
14
/**************************************************************************/
15
/**************************************************************************/
16
/**                                                                       */
17
/** LevelX Component                                                      */
18
/**                                                                       */
19
/**   NOR Flash                                                           */
20
/**                                                                       */
21
/**************************************************************************/
22
/**************************************************************************/
23
24
#define LX_SOURCE_CODE
25
26
27
/* Disable ThreadX error checking.  */
28
29
#ifndef LX_DISABLE_ERROR_CHECKING
30
#define LX_DISABLE_ERROR_CHECKING
31
#endif
32
33
34
/* Include necessary system files.  */
35
36
#include "lx_api.h"
37
38
/***************************************************************************/
39
/*                                                                         */
40
/*  FUNCTION                                               RELEASE         */
41
/*                                                                         */
42
/*    _lx_nor_flash_open                                  PORTABLE C       */
43
/*                                                           6.3.0         */
44
/*  AUTHOR                                                                 */
45
/*                                                                         */
46
/*    William E. Lamie, Microsoft Corporation                              */
47
/*                                                                         */
48
/*  DESCRIPTION                                                            */
49
/*                                                                         */
50
/*    This function opens a NOR flash instance and ensures the NOR flash   */
51
/*    is in a coherent state.                                              */
52
/*                                                                         */
53
/*  INPUT                                                                  */
54
/*                                                                         */
55
/*    nor_flash                             NOR flash instance             */
56
/*    name                                  Name of NOR flash instance     */
57
/*    nor_driver_initialize                 Driver initialize              */
58
/*                                                                         */
59
/*  OUTPUT                                                                 */
60
/*                                                                         */
61
/*    return status                                                        */
62
/*                                                                         */
63
/*  CALLS                                                                  */
64
/*  lx_nor_flash_open_extended()                                           */
65
/*                                                                         */
66
/*  CALLED BY                                                              */
67
/*                                                                         */
68
/*    Application Code                                                     */
69
/*                                                                         */
70
/*  RELEASE HISTORY                                                        */
71
/*                                                                         */
72
/*    DATE              NAME                      DESCRIPTION              */
73
/*                                                                         */
74
/*  05-19-2020     William E. Lamie         Initial Version 6.0            */
75
/*  09-30-2020     William E. Lamie         Modified comment(s),           */
76
/*                                            resulting in version 6.1     */
77
/*  11-09-2020     William E. Lamie         Modified comment(s),           */
78
/*                                            fixed compiler warnings,     */
79
/*                                            resulting in version 6.1.2   */
80
/*  12-30-2020     William E. Lamie         Modified comment(s),           */
81
/*                                            fixed compiler warnings,     */
82
/*                                            resulting in version 6.1.3   */
83
/*  06-02-2021     Bhupendra Naphade        Modified comment(s), and       */
84
/*                                            updated product constants    */
85
/*                                            resulting in version 6.1.7   */
86
/*  03-08-2023     Xiuwen Cai               Modified comment(s),           */
87
/*                                            added new driver interface,  */
88
/*                                            resulting in version 6.2.1   */
89
/*  10-31-2023     Xiuwen Cai               Modified comment(s),           */
90
/*                                            added count for minimum      */
91
/*                                            erased blocks, added         */
92
/*                                            obsolete count cache,        */
93
/*                                            avoided clearing user        */
94
/*                                            extension in flash control   */
95
/*                                            block,                       */
96
/*                                            resulting in version 6.3.0   */
97
/* 10-21-2025                              Modified comment(s)             */
98
/*                                            call the extended equivalent */
99
/*                                              API                        */
100
101
19
UINT  _lx_nor_flash_open(LX_NOR_FLASH  *nor_flash, CHAR *name, UINT (*nor_driver_initialize)(LX_NOR_FLASH *))
102
{
103
19
UINT status = LX_ERROR;
104
105
19
    status = _lx_nor_flash_open_extended(nor_flash, name, nor_driver_initialize, NULL);
106
107
19
    return status;
108
}