Skip to content

Commit c8a39c4

Browse files
committed
Merge remote-tracking branch 'origin/master' into v2-rebase-part2
2 parents 795dd8c + ec4d8b6 commit c8a39c4

File tree

10 files changed

+358
-229
lines changed

10 files changed

+358
-229
lines changed

.travis.yml

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,15 @@ jobs:
139139
- LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
140140
- LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
141141
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
142-
# Grab latests patch from repo tags, default to 0
143-
- LFS_VERSION_PATCH=$(curl -f -u "$GEKY_BOT_RELEASES"
144-
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs
145-
| jq 'map(.ref | match(
146-
"refs/tags/v'"$LFS_VERSION_MAJOR"'\\.'"$LFS_VERSION_MINOR"'\\.(.*)$")
147-
.captures[].string | tonumber + 1) | max // 0')
142+
# Grab latests patch from repo tags, default to 0, needs finagling to get past github's pagination api
143+
- PREV_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.
144+
- PREV_URL=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL" -I
145+
| sed -n '/^Link/{s/.*<\(.*\)>; rel="last"/\1/;p;q0};$q1'
146+
|| echo $PREV_URL)
147+
- LFS_VERSION_PATCH=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL"
148+
| jq 'map(.ref | match("\\bv.*\\..*\\.(.*)$";"g")
149+
.captures[].string | tonumber) | max + 1'
150+
|| echo 0)
148151
# We have our new version
149152
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.$LFS_VERSION_PATCH"
150153
- echo "VERSION $LFS_VERSION"
@@ -155,24 +158,35 @@ jobs:
155158
| jq -re '.sha')
156159
if [ "$TRAVIS_COMMIT" == "$CURRENT_COMMIT" ]
157160
then
158-
# Build release notes
159-
PREV=$(git tag --sort=-v:refname -l "v*" | head -1)
160-
if [ ! -z "$PREV" ]
161-
then
162-
echo "PREV $PREV"
163-
CHANGES=$'### Changes\n\n'$( \
164-
git log --oneline $PREV.. --grep='^Merge' --invert-grep)
165-
printf "CHANGES\n%s\n\n" "$CHANGES"
166-
fi
167-
# Create the release
161+
# Create a simple tag
168162
curl -f -u "$GEKY_BOT_RELEASES" -X POST \
169-
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
163+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
170164
-d "{
171-
\"tag_name\": \"$LFS_VERSION\",
172-
\"target_commitish\": \"$TRAVIS_COMMIT\",
173-
\"name\": \"${LFS_VERSION%.0}\",
174-
\"body\": $(jq -sR '.' <<< "$CHANGES")
165+
\"ref\": \"refs/tags/$LFS_VERSION\",
166+
\"sha\": \"$TRAVIS_COMMIT\"
175167
}"
168+
# Minor release?
169+
if [[ "$LFS_VERSION" == *.0 ]]
170+
then
171+
# Build release notes
172+
PREV=$(git tag --sort=-v:refname -l "v*.0" | head -1)
173+
if [ ! -z "$PREV" ]
174+
then
175+
echo "PREV $PREV"
176+
CHANGES=$'### Changes\n\n'$( \
177+
git log --oneline $PREV.. --grep='^Merge' --invert-grep)
178+
printf "CHANGES\n%s\n\n" "$CHANGES"
179+
fi
180+
# Create the release
181+
curl -f -u "$GEKY_BOT_RELEASES" -X POST \
182+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
183+
-d "{
184+
\"tag_name\": \"$LFS_VERSION\",
185+
\"name\": \"${LFS_VERSION%.0}\",
186+
\"draft\": true,
187+
\"body\": $(jq -sR '.' <<< "$CHANGES")
188+
}"
189+
fi
176190
fi
177191
178192
# Manage statuses

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ ifdef WORD
2525
override CFLAGS += -m$(WORD)
2626
endif
2727
override CFLAGS += -I.
28-
override CFLAGS += -std=c99 -Wall -pedantic -Wshadow -Wunused-parameter
28+
override CFLAGS += -std=c99 -Wall -pedantic
29+
override CFLAGS += -Wshadow -Wunused-parameter -Wjump-misses-init -Wsign-compare
2930

3031

3132
all: $(TARGET)

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,18 @@ handy.
176176
[littlefs-js](https://github.com/geky/littlefs-js) - A javascript wrapper for
177177
littlefs. I'm not sure why you would want this, but it is handy for demos.
178178
You can see it in action [here](http://littlefs.geky.net/demo.html).
179+
180+
[mklfs](https://github.com/whitecatboard/Lua-RTOS-ESP32/tree/master/components/mklfs/src) -
181+
A command line tool built by the [Lua RTOS](https://github.com/whitecatboard/Lua-RTOS-ESP32)
182+
guys for making littlefs images from a host PC. Supports Windows, Mac OS,
183+
and Linux.
184+
185+
[SPIFFS](https://github.com/pellepl/spiffs) - Another excellent embedded
186+
filesystem for NOR flash. As a more traditional logging filesystem with full
187+
static wear-leveling, SPIFFS will likely outperform littlefs on small
188+
memories such as the internal flash on microcontrollers.
189+
190+
[Dhara](https://github.com/dlbeer/dhara) - An interesting NAND flash
191+
translation layer designed for small MCUs. It offers static wear-leveling and
192+
power-resilience with only a fixed O(|address|) pointer structure stored on
193+
each block and in RAM.

emubd/lfs_emubd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline void lfs_emubd_tole32(lfs_emubd_t *emu) {
3030
emu->stats.prog_count = lfs_tole32(emu->stats.prog_count);
3131
emu->stats.erase_count = lfs_tole32(emu->stats.erase_count);
3232

33-
for (int i = 0; i < sizeof(emu->history.blocks) /
33+
for (unsigned i = 0; i < sizeof(emu->history.blocks) /
3434
sizeof(emu->history.blocks[0]); i++) {
3535
emu->history.blocks[i] = lfs_tole32(emu->history.blocks[i]);
3636
}
@@ -46,7 +46,7 @@ static inline void lfs_emubd_fromle32(lfs_emubd_t *emu) {
4646
emu->stats.prog_count = lfs_fromle32(emu->stats.prog_count);
4747
emu->stats.erase_count = lfs_fromle32(emu->stats.erase_count);
4848

49-
for (int i = 0; i < sizeof(emu->history.blocks) /
49+
for (unsigned i = 0; i < sizeof(emu->history.blocks) /
5050
sizeof(emu->history.blocks[0]); i++) {
5151
emu->history.blocks[i] = lfs_fromle32(emu->history.blocks[i]);
5252
}

0 commit comments

Comments
 (0)