Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/daplink/drag-n-drop/vfs_user.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file vfs_user.h |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief VFS user files header. |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * DAPLink Interface Firmware |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * Copyright (c) 2020, ARM Limited, All Rights Reserved |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 20 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | #ifndef VFS_USER_H |
Pawel Zarembski |
0:01f31e923fe2 | 23 | #define VFS_USER_H |
Pawel Zarembski |
0:01f31e923fe2 | 24 | |
Pawel Zarembski |
0:01f31e923fe2 | 25 | #include <stdbool.h> |
Pawel Zarembski |
0:01f31e923fe2 | 26 | #include "virtual_fs.h" |
Pawel Zarembski |
0:01f31e923fe2 | 27 | |
Pawel Zarembski |
0:01f31e923fe2 | 28 | #ifdef __cplusplus |
Pawel Zarembski |
0:01f31e923fe2 | 29 | extern "C" { |
Pawel Zarembski |
0:01f31e923fe2 | 30 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 31 | |
Pawel Zarembski |
0:01f31e923fe2 | 32 | //! @brief Hook for file changes in root directory. |
Pawel Zarembski |
0:01f31e923fe2 | 33 | //! |
Pawel Zarembski |
0:01f31e923fe2 | 34 | //! @param filename Name of the file that has changed. |
Pawel Zarembski |
0:01f31e923fe2 | 35 | //! @param change Type of change. |
Pawel Zarembski |
0:01f31e923fe2 | 36 | //! @param file |
Pawel Zarembski |
0:01f31e923fe2 | 37 | //! @param new_file_data Data being written to the file if _change_ is #VFS_FILE_CHANGED. |
Pawel Zarembski |
0:01f31e923fe2 | 38 | //! @retval true The hook handled the change notification, the caller should do nothing else. |
Pawel Zarembski |
0:01f31e923fe2 | 39 | //! @retval false The hook did nothing, continue with normal behaviour. |
Pawel Zarembski |
0:01f31e923fe2 | 40 | bool vfs_user_file_change_handler_hook(const vfs_filename_t filename, |
Pawel Zarembski |
0:01f31e923fe2 | 41 | vfs_file_change_t change, vfs_file_t file, vfs_file_t new_file_data); |
Pawel Zarembski |
0:01f31e923fe2 | 42 | |
Pawel Zarembski |
0:01f31e923fe2 | 43 | //! @brief Hook for magic files. |
Pawel Zarembski |
0:01f31e923fe2 | 44 | //! |
Pawel Zarembski |
0:01f31e923fe2 | 45 | //! This hook is intended to simplify checking for magic files. In addition to allowing support for |
Pawel Zarembski |
0:01f31e923fe2 | 46 | //! new magic files, you can also change the behaviour of or disable standard magic files. |
Pawel Zarembski |
0:01f31e923fe2 | 47 | //! |
Pawel Zarembski |
0:01f31e923fe2 | 48 | //! @param filename Name of the file that was created. |
Pawel Zarembski |
0:01f31e923fe2 | 49 | //! @param[out] do_remount Whether the caller should remount the MSD volume. Only applies if true |
Pawel Zarembski |
0:01f31e923fe2 | 50 | //! is returned. The default is true, so if the hook does not modify this parameter and returns |
Pawel Zarembski |
0:01f31e923fe2 | 51 | //! true, a remount is performed. |
Pawel Zarembski |
0:01f31e923fe2 | 52 | //! @retval true The hook handled the specified file. A remount will be performed if requested, |
Pawel Zarembski |
0:01f31e923fe2 | 53 | //! but otherwise no other standard behaviour is applied. |
Pawel Zarembski |
0:01f31e923fe2 | 54 | //! @retval false The hook did not handle the file; continue with canonical behaviour. |
Pawel Zarembski |
0:01f31e923fe2 | 55 | bool vfs_user_magic_file_hook(const vfs_filename_t filename, bool *do_remount); |
Pawel Zarembski |
0:01f31e923fe2 | 56 | |
Pawel Zarembski |
0:01f31e923fe2 | 57 | #ifdef __cplusplus |
Pawel Zarembski |
0:01f31e923fe2 | 58 | } |
Pawel Zarembski |
0:01f31e923fe2 | 59 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 60 | |
Pawel Zarembski |
0:01f31e923fe2 | 61 | #endif // VFS_USER_H |