Skip to content

Commit f3429a3

Browse files
authored
Merge pull request #8445 from ithinuel/rfc-spi-overhaul-ref-impl
RFC SPI: Reference Implementation.
2 parents eb59056 + 904ff17 commit f3429a3

File tree

68 files changed

+1545
-959
lines changed

Some content is hidden

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

68 files changed

+1545
-959
lines changed

.travis.yml

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -197,76 +197,76 @@ matrix:
197197
fi
198198
- bash -c "$STATUS" success "$STATUSM"
199199

200-
- env:
201-
- NAME=littlefs
202-
- LITTLEFS=features/storage/filesystem/littlefs
203-
install:
204-
# Install dependencies
205-
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
206-
- pip install -r requirements.txt
207-
# Print versions
208-
- arm-none-eabi-gcc --version
209-
- gcc --version
210-
- python --version
211-
- fusermount --version
212-
before_script:
213-
# Setup and patch littlefs-fuse
214-
- git clone https://github.com/armmbed/littlefs-fuse littlefs_fuse
215-
- git -C littlefs_fuse checkout 3f1ed6e37799e49e3710830dc6abb926d5503cf2
216-
- echo '*' > littlefs_fuse/.mbedignore
217-
- rm -rf littlefs_fuse/littlefs/*
218-
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) littlefs_fuse/littlefs
219-
# Create file-backed disk
220-
- mkdir MOUNT
221-
- sudo chmod a+rw /dev/loop0
222-
- dd if=/dev/zero bs=512 count=2048 of=DISK
223-
- losetup /dev/loop0 DISK
224-
- CFLAGS="-Werror -Wno-format"
225-
script:
226-
# Check that example compiles
227-
- export CFLAGS="-Werror -Wno-format"
228-
- sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
229-
- python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
230-
# Run local littlefs tests
231-
- make -C$LITTLEFS/littlefs test QUIET=1
232-
# Run local littlefs tests with set of variations
233-
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64"
234-
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
235-
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
236-
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
237-
- make -C$LITTLEFS/littlefs clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
238-
# Self-hosting littlefs fuzz test with littlefs-fuse
239-
- make -Clittlefs_fuse
240-
- littlefs_fuse/lfs --format /dev/loop0
241-
- littlefs_fuse/lfs /dev/loop0 MOUNT
242-
- ls MOUNT
243-
- mkdir MOUNT/littlefs
244-
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
245-
- ls MOUNT/littlefs
246-
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs test_files QUIET=1
247-
# Compile and find the code size with smallest configuration
248-
- cd $TRAVIS_BUILD_DIR/$LITTLEFS/littlefs
249-
- make clean size
250-
CC='arm-none-eabi-gcc -mthumb'
251-
OBJ="$(ls lfs*.o | tr '\n' ' ')"
252-
CFLAGS+="-DLFS_NO_ASSERT -DLFS_NO_DEBUG -DLFS_NO_WARN -DLFS_NO_ERROR"
253-
| tee sizes
254-
after_success:
255-
# update status if we succeeded, compare with master if possible
256-
- |
257-
CURR=$(tail -n1 sizes | awk '{print $1}')
258-
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
259-
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
260-
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
261-
| capture(\"code size is (?<size>[0-9]+)\").size" \
262-
|| echo 0)
200+
# - env:
201+
# - NAME=littlefs
202+
# - LITTLEFS=features/storage/filesystem/littlefs
203+
# install:
204+
# # Install dependencies
205+
# - sudo apt-get install gcc-arm-embedded fuse libfuse-dev
206+
# - pip install -r requirements.txt
207+
# # Print versions
208+
# - arm-none-eabi-gcc --version
209+
# - gcc --version
210+
# - python --version
211+
# - fusermount --version
212+
# before_script:
213+
# # Setup and patch littlefs-fuse
214+
# - git clone https://github.com/armmbed/littlefs-fuse littlefs_fuse
215+
# - git -C littlefs_fuse checkout 3f1ed6e37799e49e3710830dc6abb926d5503cf2
216+
# - echo '*' > littlefs_fuse/.mbedignore
217+
# - rm -rf littlefs_fuse/littlefs/*
218+
# - cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) littlefs_fuse/littlefs
219+
# # Create file-backed disk
220+
# - mkdir MOUNT
221+
# - sudo chmod a+rw /dev/loop0
222+
# - dd if=/dev/zero bs=512 count=2048 of=DISK
223+
# - losetup /dev/loop0 DISK
224+
# - CFLAGS="-Werror -Wno-format"
225+
# script:
226+
# # Check that example compiles
227+
# - export CFLAGS="-Werror -Wno-format"
228+
# - sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
229+
# - python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
230+
# # Run local littlefs tests
231+
# - make -C$LITTLEFS/littlefs test QUIET=1
232+
# # Run local littlefs tests with set of variations
233+
# - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64"
234+
# - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
235+
# - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
236+
# - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
237+
# - make -C$LITTLEFS/littlefs clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
238+
# # Self-hosting littlefs fuzz test with littlefs-fuse
239+
# - make -Clittlefs_fuse
240+
# - littlefs_fuse/lfs --format /dev/loop0
241+
# - littlefs_fuse/lfs /dev/loop0 MOUNT
242+
# - ls MOUNT
243+
# - mkdir MOUNT/littlefs
244+
# - cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
245+
# - ls MOUNT/littlefs
246+
# - CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs test_files QUIET=1
247+
# # Compile and find the code size with smallest configuration
248+
# - cd $TRAVIS_BUILD_DIR/$LITTLEFS/littlefs
249+
# - make clean size
250+
# CC='arm-none-eabi-gcc -mthumb'
251+
# OBJ="$(ls lfs*.o | tr '\n' ' ')"
252+
# CFLAGS+="-DLFS_NO_ASSERT -DLFS_NO_DEBUG -DLFS_NO_WARN -DLFS_NO_ERROR"
253+
# | tee sizes
254+
# after_success:
255+
# # update status if we succeeded, compare with master if possible
256+
# - |
257+
# CURR=$(tail -n1 sizes | awk '{print $1}')
258+
# PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
259+
# | jq -re "select(.sha != \"$TRAVIS_COMMIT\")
260+
# | .statuses[] | select(.context == \"travis-ci/$NAME\").description
261+
# | capture(\"code size is (?<size>[0-9]+)\").size" \
262+
# || echo 0)
263263

264-
STATUSM="Passed, code size is ${CURR}B"
265-
if [ "$PREV" -ne 0 ]
266-
then
267-
STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
268-
fi
269-
- bash -c "$STATUS" success "$STATUSM"
264+
# STATUSM="Passed, code size is ${CURR}B"
265+
# if [ "$PREV" -ne 0 ]
266+
# then
267+
# STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
268+
# fi
269+
# - bash -c "$STATUS" success "$STATUSM"
270270

271271
- env:
272272
- NAME=gitattributestest

components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class UnlockedSPI : public SPI {
237237
public:
238238
UnlockedSPI(PinName mosi, PinName miso, PinName sclk) :
239239
SPI(mosi, miso, sclk) { }
240-
virtual void lock() { }
240+
virtual bool lock() { return true; }
241241
virtual void unlock() { }
242242
};
243243

components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class UnlockedSPI : public SPI {
102102
public:
103103
UnlockedSPI(PinName sdi, PinName sdo, PinName sclk) :
104104
SPI(sdi, sdo, sclk) { }
105-
virtual void lock() { }
105+
virtual bool lock() { return true; }
106106
virtual void unlock() { }
107107
};
108108

0 commit comments

Comments
 (0)