* @brief this function will lock device file system. * this lock (fslock) is used for protecting filesystem_operation_table and filesystem_table. * * @note please don't invoke it on ISR. */
| 113 | * @note please don't invoke it on ISR. |
| 114 | */ |
| 115 | void dfs_lock(void) |
| 116 | { |
| 117 | rt_err_t result = -RT_EBUSY; |
| 118 | |
| 119 | while (result == -RT_EBUSY) |
| 120 | { |
| 121 | result = rt_mutex_take(&fslock, RT_WAITING_FOREVER); |
| 122 | } |
| 123 | |
| 124 | if (result != RT_EOK) |
| 125 | { |
| 126 | RT_ASSERT(0); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * @brief this function will lock file descriptors. |
no test coverage detected