Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Fix for #7 and #9 #10

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 5 additions & 2 deletions cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@

#if defined(__cplusplus)
#if !defined(ARDUINO_AS_MBED_LIBRARY)
#define PinMode MbedPinMode
// Temporary workaround for:
// https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/9
//#define PinMode MbedPinMode
#ifdef F
#define Arduino_F F
#undef F
#endif // F (mbed included after arduino.h)
#define F Mbed_F
#endif // !ARDUINO_AS_MBED_LIBRARY
#include "mbed.h"
#undef PinMode
//#undef PinMode
#define PinMode ArduinoPinMode
#undef F
#endif //__cplusplus

Expand Down
81 changes: 81 additions & 0 deletions cores/arduino/mbed/TESTS/integration/COMMON/common_defines_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* mbed Microcontroller Library
* Copyright (c) 2006-2019 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#define ETHERNET 1
#define WIFI 2
#define MESH 3
#define CELLULAR 4

#if !defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE)
#error [NOT_SUPPORTED] No network interface found on this target.
#endif

#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == ETHERNET
#define TEST_NETWORK_TYPE "Ethernet"
#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == WIFI
#define TEST_NETWORK_TYPE "WiFi"
#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
#define TEST_NETWORK_TYPE "Mesh"
#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == CELLULAR
#define TEST_NETWORK_TYPE "Cellular"
#else
#error [NOT_SUPPORTED] Either WiFi, Ethernet or Cellular network interface need to be enabled
#endif

#define FS_FAT 1
#define FS_LFS 2

#if COMPONENT_SPIF
#define TEST_BLOCK_DEVICE_TYPE "SPIF"
#elif COMPONENT_QSPIF
#define TEST_BLOCK_DEVICE_TYPE "QSPIF"
#elif COMPONENT_DATAFLASH
#define TEST_BLOCK_DEVICE_TYPE "DATAFLASH"
#elif COMPONENT_SD
#define TEST_BLOCK_DEVICE_TYPE "SD"
#define TEST_USE_FILESYSTEM FS_FAT
#elif COMPONENT_FLASHIAP
#define TEST_BLOCK_DEVICE_TYPE "FLASHIAP"
#elif COMPONENT_SDIO
#define TEST_BLOCK_DEVICE_TYPE "SDIO"
#elif COMPONENT_NUSD
#define TEST_BLOCK_DEVICE_TYPE "NUSD"
#define TEST_USE_FILESYSTEM FS_FAT
#else
#define TEST_BLOCK_DEVICE_TYPE "UNKNOWN"
#endif

#if !defined(TEST_USE_FILESYSTEM)
#define TEST_USE_FILESYSTEM FS_LFS
#endif

#if TEST_USE_FILESYSTEM == FS_FAT
#define TEST_FILESYSTEM_TYPE "FAT"
#elif TEST_USE_FILESYSTEM == FS_LFS
#define TEST_FILESYSTEM_TYPE "LFS"
#else
#define TEST_FILESYSTEM_TYPE "UNKNOWN"
#endif

#define TEST_MEMORY_SIZE_10K 10240
#define TEST_MEMORY_SIZE_20K 20480
#define TEST_MEMORY_SIZE_40K 40960
#define TEST_MEMORY_SIZE_60K 61440
#define TEST_MEMORY_SIZE_80K 81920
#define TEST_MEMORY_SIZE_100K 102400
25 changes: 25 additions & 0 deletions cores/arduino/mbed/TESTS/integration/COMMON/download_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* mbed Microcontroller Library
* Copyright (c) 2006-2019 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

size_t download_test(NetworkInterface *interface, const unsigned char *data, size_t data_length, size_t buff_size, uint32_t thread_id = 0);

26 changes: 26 additions & 0 deletions cores/arduino/mbed/TESTS/integration/COMMON/file_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* mbed Microcontroller Library
* Copyright (c) 2006-2018 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

void file_test_write(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);

void file_test_read(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);
Loading