SDHI_driver patch (mbedOS 5.11.5)
mbed-os-program/mbed-os/components/storage/blockdevice/COMPONENT_RZ_SDHI/TESTS/COMMON/fsfat_debug.h@2:7c75ab32d7c9, 2019-03-29 (annotated)
- Committer:
- tvendov
- Date:
- Fri Mar 29 19:47:34 2019 +0200
- Revision:
- 2:7c75ab32d7c9
Fix: Folder structure changed. All SD Auto tests pass with OK!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tvendov | 2:7c75ab32d7c9 | 1 | /* mbed Microcontroller Library |
tvendov | 2:7c75ab32d7c9 | 2 | * Copyright (c) 2016 ARM Limited |
tvendov | 2:7c75ab32d7c9 | 3 | * |
tvendov | 2:7c75ab32d7c9 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
tvendov | 2:7c75ab32d7c9 | 5 | * you may not use this file except in compliance with the License. |
tvendov | 2:7c75ab32d7c9 | 6 | * You may obtain a copy of the License at |
tvendov | 2:7c75ab32d7c9 | 7 | * |
tvendov | 2:7c75ab32d7c9 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
tvendov | 2:7c75ab32d7c9 | 9 | * |
tvendov | 2:7c75ab32d7c9 | 10 | * Unless required by applicable law or agreed to in writing, software |
tvendov | 2:7c75ab32d7c9 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
tvendov | 2:7c75ab32d7c9 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
tvendov | 2:7c75ab32d7c9 | 13 | * See the License for the specific language governing permissions and |
tvendov | 2:7c75ab32d7c9 | 14 | * limitations under the License. |
tvendov | 2:7c75ab32d7c9 | 15 | */ |
tvendov | 2:7c75ab32d7c9 | 16 | |
tvendov | 2:7c75ab32d7c9 | 17 | /** @file fsfat_debug.h |
tvendov | 2:7c75ab32d7c9 | 18 | * |
tvendov | 2:7c75ab32d7c9 | 19 | * component debug header file. |
tvendov | 2:7c75ab32d7c9 | 20 | */ |
tvendov | 2:7c75ab32d7c9 | 21 | |
tvendov | 2:7c75ab32d7c9 | 22 | |
tvendov | 2:7c75ab32d7c9 | 23 | #ifndef __FSFAT_DEBUG |
tvendov | 2:7c75ab32d7c9 | 24 | #define __FSFAT_DEBUG |
tvendov | 2:7c75ab32d7c9 | 25 | |
tvendov | 2:7c75ab32d7c9 | 26 | #include <stdint.h> |
tvendov | 2:7c75ab32d7c9 | 27 | #include <assert.h> |
tvendov | 2:7c75ab32d7c9 | 28 | #include <stdio.h> |
tvendov | 2:7c75ab32d7c9 | 29 | |
tvendov | 2:7c75ab32d7c9 | 30 | |
tvendov | 2:7c75ab32d7c9 | 31 | /* Debug Support */ |
tvendov | 2:7c75ab32d7c9 | 32 | |
tvendov | 2:7c75ab32d7c9 | 33 | #define FSFAT_LOG_NONE 0 |
tvendov | 2:7c75ab32d7c9 | 34 | #define FSFAT_LOG_ERR 1 |
tvendov | 2:7c75ab32d7c9 | 35 | #define FSFAT_LOG_WARN 2 |
tvendov | 2:7c75ab32d7c9 | 36 | #define FSFAT_LOG_NOTICE 3 |
tvendov | 2:7c75ab32d7c9 | 37 | #define FSFAT_LOG_INFO 4 |
tvendov | 2:7c75ab32d7c9 | 38 | #define FSFAT_LOG_DEBUG 5 |
tvendov | 2:7c75ab32d7c9 | 39 | #define FSFAT_LOG_FENTRY 6 |
tvendov | 2:7c75ab32d7c9 | 40 | |
tvendov | 2:7c75ab32d7c9 | 41 | #define FSFAT_LOG(_fmt, ...) \ |
tvendov | 2:7c75ab32d7c9 | 42 | do \ |
tvendov | 2:7c75ab32d7c9 | 43 | { \ |
tvendov | 2:7c75ab32d7c9 | 44 | printf(_fmt, __VA_ARGS__); \ |
tvendov | 2:7c75ab32d7c9 | 45 | }while(0); |
tvendov | 2:7c75ab32d7c9 | 46 | |
tvendov | 2:7c75ab32d7c9 | 47 | #define noFSFAT_DEBUG |
tvendov | 2:7c75ab32d7c9 | 48 | #ifdef FSFAT_DEBUG |
tvendov | 2:7c75ab32d7c9 | 49 | |
tvendov | 2:7c75ab32d7c9 | 50 | extern uint32_t fsfat_optDebug_g; |
tvendov | 2:7c75ab32d7c9 | 51 | extern uint32_t fsfat_optLogLevel_g; |
tvendov | 2:7c75ab32d7c9 | 52 | |
tvendov | 2:7c75ab32d7c9 | 53 | |
tvendov | 2:7c75ab32d7c9 | 54 | /* uncomment for asserts to work */ |
tvendov | 2:7c75ab32d7c9 | 55 | /* #undef NDEBUG */ |
tvendov | 2:7c75ab32d7c9 | 56 | // todo: port to mbedOSV3++ #include <core-util/assert.h> |
tvendov | 2:7c75ab32d7c9 | 57 | |
tvendov | 2:7c75ab32d7c9 | 58 | #define FSFAT_INLINE |
tvendov | 2:7c75ab32d7c9 | 59 | // todo: port to mbedOSV3++ #define FSFAT_ASSERT CORE_UTIL_ASSERT |
tvendov | 2:7c75ab32d7c9 | 60 | #define FSFAT_ASSERT(...) |
tvendov | 2:7c75ab32d7c9 | 61 | |
tvendov | 2:7c75ab32d7c9 | 62 | #define FSFAT_DBGLOG(_fmt, ...) \ |
tvendov | 2:7c75ab32d7c9 | 63 | do \ |
tvendov | 2:7c75ab32d7c9 | 64 | { \ |
tvendov | 2:7c75ab32d7c9 | 65 | if(fsfat_optDebug_g && (fsfat_optLogLevel_g >= FSFAT_LOG_DEBUG)) \ |
tvendov | 2:7c75ab32d7c9 | 66 | { \ |
tvendov | 2:7c75ab32d7c9 | 67 | printf(_fmt, __VA_ARGS__); \ |
tvendov | 2:7c75ab32d7c9 | 68 | } \ |
tvendov | 2:7c75ab32d7c9 | 69 | }while(0); |
tvendov | 2:7c75ab32d7c9 | 70 | |
tvendov | 2:7c75ab32d7c9 | 71 | |
tvendov | 2:7c75ab32d7c9 | 72 | #define FSFAT_ERRLOG(_fmt, ...) \ |
tvendov | 2:7c75ab32d7c9 | 73 | do \ |
tvendov | 2:7c75ab32d7c9 | 74 | { \ |
tvendov | 2:7c75ab32d7c9 | 75 | if(fsfat_optDebug_g && (fsfat_optLogLevel_g >= FSFAT_LOG_ERR)) \ |
tvendov | 2:7c75ab32d7c9 | 76 | { \ |
tvendov | 2:7c75ab32d7c9 | 77 | printf(_fmt, __VA_ARGS__); \ |
tvendov | 2:7c75ab32d7c9 | 78 | } \ |
tvendov | 2:7c75ab32d7c9 | 79 | }while(0); |
tvendov | 2:7c75ab32d7c9 | 80 | |
tvendov | 2:7c75ab32d7c9 | 81 | |
tvendov | 2:7c75ab32d7c9 | 82 | #define FSFAT_FENTRYLOG(_fmt, ...) \ |
tvendov | 2:7c75ab32d7c9 | 83 | do \ |
tvendov | 2:7c75ab32d7c9 | 84 | { \ |
tvendov | 2:7c75ab32d7c9 | 85 | if(fsfat_optDebug_g && (fsfat_optLogLevel_g >= FSFAT_LOG_FENTRY)) \ |
tvendov | 2:7c75ab32d7c9 | 86 | { \ |
tvendov | 2:7c75ab32d7c9 | 87 | printf(_fmt, __VA_ARGS__); \ |
tvendov | 2:7c75ab32d7c9 | 88 | } \ |
tvendov | 2:7c75ab32d7c9 | 89 | }while(0); |
tvendov | 2:7c75ab32d7c9 | 90 | |
tvendov | 2:7c75ab32d7c9 | 91 | |
tvendov | 2:7c75ab32d7c9 | 92 | |
tvendov | 2:7c75ab32d7c9 | 93 | |
tvendov | 2:7c75ab32d7c9 | 94 | |
tvendov | 2:7c75ab32d7c9 | 95 | #else |
tvendov | 2:7c75ab32d7c9 | 96 | #define FSFAT_ASSERT(_x) do { } while(0) |
tvendov | 2:7c75ab32d7c9 | 97 | #define FSFAT_INLINE inline |
tvendov | 2:7c75ab32d7c9 | 98 | #define FSFAT_DBGLOG(_fmt, ...) do { } while(0) |
tvendov | 2:7c75ab32d7c9 | 99 | #define FSFAT_ERRLOG(_fmt, ...) do { } while(0) |
tvendov | 2:7c75ab32d7c9 | 100 | #define FSFAT_FENTRYLOG(_fmt, ...) do { } while(0) |
tvendov | 2:7c75ab32d7c9 | 101 | #endif /* FSFAT_DEBUG */ |
tvendov | 2:7c75ab32d7c9 | 102 | |
tvendov | 2:7c75ab32d7c9 | 103 | |
tvendov | 2:7c75ab32d7c9 | 104 | #endif /*__FSFAT_DEBUG*/ |