* this function will lock device file system. * * @note please don't invoke it on ISR. */
| 156 | * @note please don't invoke it on ISR. |
| 157 | */ |
| 158 | rt_err_t dfs_lock(void) |
| 159 | { |
| 160 | rt_err_t result = -RT_EBUSY; |
| 161 | |
| 162 | while (result == -RT_EBUSY) |
| 163 | { |
| 164 | result = rt_mutex_take(&fslock, RT_WAITING_FOREVER); |
| 165 | } |
| 166 | |
| 167 | return result; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * this function will unlock device file system. |
no test coverage detected