Skip to content

Commit 885cdef

Browse files
committed
Add standard pin-names validation script & tests
1 parent 500ddf5 commit 885cdef

File tree

143 files changed

+2479
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+2479
-21
lines changed

.codecheckignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
^hal/storage_abstraction
2020
^hal/tests/TESTS/mbed_hal/trng/pithy
2121
^hal/tests/TESTS/mbed_hal/trng/pithy
22+
^hal/tests/TESTS/pin_names/test_files
2223
^platform/cxxsupport
2324
^platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV
2425
^platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,25 @@ matrix:
321321
CFLAGS+="-DLFS_NO_ASSERT -DLFS_NO_DEBUG -DLFS_NO_WARN -DLFS_NO_ERROR"
322322
| tee sizes
323323
- ccache -s
324+
- <<: extended-pinvalidate
325+
stage: "Extended"
326+
name: "pinvalidate"
327+
env: NAME=pinvalidate
328+
language: python
329+
python: 3.7
330+
install:
331+
# Install python modules
332+
- python -m pip install --upgrade pip==18.1
333+
- python -m pip install --upgrade setuptools==40.4.3
334+
- pip install tabulate argparse
335+
- pip list --verbose
336+
# Fetch remaining information needed for branch comparison
337+
- git fetch --all --unshallow --tags
338+
- git fetch origin "${TRAVIS_BRANCH}"
339+
script:
340+
- >-
341+
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
342+
| ( grep '.*[\\|\/]PinNames.h$' || true ) \
343+
| while read file; do python ./hal/tests/TESTS/pin_names/pinvalidate.py -vfp "${file}"; done
344+
- git diff --exit-code --diff-filter=d --color
345+

hal/source/mbed_pinmap_default.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static const PinList ff_arduino_uno_list = {
4343
ff_arduino_uno_pins
4444
};
4545

46-
static_assert(sizeof(ff_arduino_pins) / sizeof(ff_arduino_pins[0]) == sizeof(ff_arduino_names) / sizeof(ff_arduino_names[0]),
46+
static_assert(sizeof(ff_arduino_uno_pins) / sizeof(ff_arduino_uno_pins[0]) == sizeof(ff_arduino_uno_names) / sizeof(ff_arduino_uno_names[0]),
4747
"Arrays must have the same length");
4848

4949
const PinList *pinmap_ff_arduino_uno_pins()

hal/tests/TESTS/mbed_hal/gpio/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

hal/tests/TESTS/pin_names/arduino_uno/main.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
Requirements specified in docs/design-documents/hal/0005-pin-names-Arduino-Uno-standard.md
2525
*/
2626

27-
#if !(defined (TARGET_FF_ARDUINO) || (TARGET_FF_ARDUINO_UNO))
27+
#if !(defined (TARGET_FF_ARDUINO_UNO))
2828
#error [NOT_SUPPORTED] Test needs Arduino Uno form factor
2929
#else
3030

31-
#if defined (TARGET_FF_ARDUINO)
32-
#warning ARDUINO form factor should not be used any more => use ARDUINO_UNO
33-
#endif
34-
3531
using namespace utest::v1;
3632

3733
template <PinName TestedPin>
@@ -190,8 +186,6 @@ void I2C_test()
190186
}
191187

192188
I2C i2c(SDA_pin, SCL_pin);
193-
// Basic API call
194-
i2c.read(0);
195189
}
196190

197191

0 commit comments

Comments
 (0)