File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2025 NXP
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ mainmenu "ZMS sample configuration"
5+
6+ config MAX_ITERATIONS
7+ int "The number of iterations that the sample writes the all set of data."
8+ default 300
9+ range 1 300
10+
11+ config DELETE_ITERATION
12+ int "The number of iterations after the sample delete all set of data and verify that it has been deleted."
13+ default 10
14+ range 1 MAX_ITERATIONS
15+
16+ source "Kconfig.zephyr"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Overview
2020 A loop is executed where we mount the storage system, and then write all set
2121 of data.
2222
23- Each DELETE_ITERATION period, we delete all set of data and verify that it has been deleted.
23+ Each CONFIG_DELETE_ITERATION period, we delete all set of data and verify that it has been deleted.
2424 We generate as well incremented ID/value pairs, we store them until storage is full, then we
2525 delete them and verify that storage is empty.
2626
Original file line number Diff line number Diff line change @@ -26,9 +26,6 @@ static struct zms_fs fs;
2626#define CNT_ID 2
2727#define LONG_DATA_ID 3
2828
29- #define MAX_ITERATIONS 300
30- #define DELETE_ITERATION 10
31-
3229static int delete_and_verify_items (struct zms_fs * fs , uint32_t id )
3330{
3431 int rc = 0 ;
@@ -112,7 +109,7 @@ int main(void)
112109 fs .sector_size = info .size ;
113110 fs .sector_count = 3U ;
114111
115- for (i = 0 ; i < MAX_ITERATIONS ; i ++ ) {
112+ for (i = 0 ; i < CONFIG_MAX_ITERATIONS ; i ++ ) {
116113 rc = zms_mount (& fs );
117114 if (rc ) {
118115 printk ("Storage Init failed, rc=%d\n" , rc );
@@ -195,16 +192,16 @@ int main(void)
195192 break ;
196193 }
197194
198- /* Each DELETE_ITERATION delete all basic items */
199- if (!(i % DELETE_ITERATION ) && (i )) {
195+ /* Each CONFIG_DELETE_ITERATION delete all basic items */
196+ if (!(i % CONFIG_DELETE_ITERATION ) && (i )) {
200197 rc = delete_basic_items (& fs );
201198 if (rc ) {
202199 break ;
203200 }
204201 }
205202 }
206203
207- if (i != MAX_ITERATIONS ) {
204+ if (i != CONFIG_MAX_ITERATIONS ) {
208205 printk ("Error: Something went wrong at iteration %u rc=%d\n" , i , rc );
209206 return 0 ;
210207 }
You can’t perform that action at this time.
0 commit comments