Skip to content

Commit 64c9e1f

Browse files
committed
Portenta split wiced_filesystem.h to avoid cpp BlockDevice inclusion from Cypress layer
1 parent b34a436 commit 64c9e1f

File tree

3 files changed

+50
-12
lines changed

3 files changed

+50
-12
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2020 Arduino SA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/** @file
19+
* Provides wiced fs porting to generic mbed APIs
20+
*/
21+
22+
#pragma once
23+
24+
#include "whd_config.h"
25+
#include "BlockDevice.h"
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
31+
/******************************************************
32+
* Type Definitions
33+
******************************************************/
34+
35+
/**
36+
* Mount the physical device
37+
*
38+
* This assumes that the device is ready to read/write immediately.
39+
*
40+
* @param[in] device - physical media to init
41+
* @param[out] fs_handle_out - Receives the filesystem handle.
42+
*
43+
* @return WICED_SUCCESS on success
44+
*/
45+
wiced_result_t wiced_filesystem_mount(mbed::BlockDevice *device, wiced_filesystem_handle_type_t fs_type, wiced_filesystem_t *fs_handle_out, const char *mounted_name);
46+
47+
#ifdef __cplusplus
48+
} /*extern "C" */
49+
#endif

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/port/wiced_filesystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "sockets.h"
2727
#include "resources.h"
2828
#include "wiced_filesystem.h"
29+
#include "wiced_bd.h"
2930
#include "QSPIFBlockDevice.h"
3031
#include "MBRBlockDevice.h"
3132
#include "FATFileSystem.h"

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/port/wiced_filesystem.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#pragma once
2323

2424
#include "whd_config.h"
25-
#include "BlockDevice.h"
2625

2726
#ifdef __cplusplus
2827
extern "C" {
@@ -82,17 +81,6 @@ typedef int wiced_filesystem_handle_type_t;
8281
*/
8382
wiced_result_t wiced_filesystem_init(void);
8483

85-
/**
86-
* Mount the physical device
87-
*
88-
* This assumes that the device is ready to read/write immediately.
89-
*
90-
* @param[in] device - physical media to init
91-
* @param[out] fs_handle_out - Receives the filesystem handle.
92-
*
93-
* @return WICED_SUCCESS on success
94-
*/
95-
wiced_result_t wiced_filesystem_mount(mbed::BlockDevice *device, wiced_filesystem_handle_type_t fs_type, wiced_filesystem_t *fs_handle_out, const char *mounted_name);
9684
/**
9785
* Open a file for reading or writing
9886
*

0 commit comments

Comments
 (0)