From 74f094d4e9d54d50373381e4a9e2e982b49bd1aa Mon Sep 17 00:00:00 2001 From: Avamander Date: Sun, 17 Jan 2021 20:53:04 +0200 Subject: Create FUNDING.yml Added a link to the LiberaPay donation page diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..3af8fb9 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +liberapay: JF002 -- cgit v0.10.2 From 66a296d0f315c0f6e4643b5914216d64217b8903 Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Thu, 21 Jan 2021 07:51:43 +0000 Subject: changed command MemoryDataAccessControl from 036 to 0x36 in St7789 class diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index 053cacc..a487a95 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -58,7 +58,7 @@ namespace Pinetime { ColumnAddressSet = 0x2a, RowAddressSet = 0x2b, WriteToRam = 0x2c, - MemoryDataAccessControl = 036, + MemoryDataAccessControl = 0x36, VerticalScrollDefinition = 0x33, VerticalScrollStartAddress = 0x37, ColMod = 0x3a, -- cgit v0.10.2 From a028c39ddd9994a5932d231ead0007ec34bbdf95 Mon Sep 17 00:00:00 2001 From: petter <39340152+petterhs@users.noreply.github.com> Date: Sat, 23 Jan 2021 01:51:07 +0100 Subject: check for cmake build-success before running post-build.sh diff --git a/docker/build.sh b/docker/build.sh index f35c2f3..8f0d0fa 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -31,8 +31,8 @@ main() { CmakeGenerate CmakeBuild $target - - if [[ "$DISABLE_POSTBUILD" != "true" ]]; then + BUILD_RESULT=$? + if [ "$DISABLE_POSTBUILD" != "true" -a "$BUILD_RESULT" == 0 ]; then source "$BUILD_DIR/post_build.sh" fi } @@ -70,7 +70,9 @@ CmakeGenerate() { CmakeBuild() { local target="$1" [[ -n "$target" ]] && target="--target $target" - cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) + if cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) + then return 0; else return 1; + fi } [[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!" \ No newline at end of file -- cgit v0.10.2 From 0a169b15f18406b0ccaaedea879681015d51defb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sat, 23 Jan 2021 21:05:37 +0100 Subject: Upgrade feature list in main README.md file. diff --git a/README.md b/README.md index e1819d0..f8b05bd 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,18 @@ As of now, here is the list of achievements of this project: - Time synchronization via BLE - Notification via BLE - Multiple 'apps' : - * Clock (displays the date, time, battery level, BLE connection status, heart rate and step count) - * Heart rate - * Motion - * System info (displays various info : BLE MAC, build date/time, uptime, version, ...) - * Brightness (allows the user to configure the brightness of the display) + * Clock (displays the date, time, battery level, ble connection status, heart rate) + * System info (displays various info : BLE MAC, build date/time, uptime, version,...) + * Brightess (allows the user to configure the brightness of the display) + * Music (control the playback of the music on your phone) + * Heart rate (controls the heart rate sensor and display current heartbeat) + * Navigation (displays navigation instructions coming from the companion app) + * Notification (displays the last notification received) + * Paddle (single player pong-like game) + * Two (2048 clone game) - Supported by 2 companion apps (development is in progress): * [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android) - * [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS) + * [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux) - **[Experimental]** OTA (Over-the-air) update via BLE - **[Experimental]** Bootloader based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/) -- cgit v0.10.2 From d6557c93f27e93e79944d2533c639e1b0654d8d0 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 18:15:38 +0200 Subject: Create CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a6fa682 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +This contribution guide is in progress, improvements are welcome. + +### Code style + +Any C++ code PRs should aim to follow the style of existing code in the project. + +Using an autoformatter is heavily recommended, but make sure it's configured properly. + +There's currently preconfigured autoformatter rules for: + + * CLion (IntelliJ) in .idea/codeStyles/Project.xml + +You can use those to configure your own IDE if it's not already on the list. + +#### Linting errors and compiler warnings + +Try to avoid any currently enabled warnings and try to reduce the amount of linter errors. + +#### Spelling + +Make sure you spellcheck your code before commiting it. + +#### TODO, FIXME + +Check before commiting that you haven't forgotten anything, preferably don't leave these in your commits. + +#### Licence headers + +You should add your name to the comma-space separated list of contributors if there's a license header. + +### License + +By contributing you agree to licence your code under the repository's general license (which is currently GPL-v3+). -- cgit v0.10.2 From 04fd4a7d03fe88a44807ca62b3697dfe5864b56c Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 18:48:06 +0200 Subject: Create .gitconfig diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..b227447 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,5 @@ +[core] + whitespace = blank-at-eol,blank-at-eof,space-before-tab + autocrlf = input +[apply] + whitespace = fix -- cgit v0.10.2 From f6927548419542ce1540b6c1419b1c854fd17c8c Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 18:52:14 +0200 Subject: Create .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2257cac --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.c text +*.cpp text +*.h text +*.hpp text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.bin binary +*.jpg binary +*.jpeg binary -- cgit v0.10.2 From 4371b7fecced6b222dfa02cb71ecbb4ff54b6785 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 19:11:07 +0200 Subject: Update CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5955d39..4580609 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -610,7 +610,7 @@ include_directories( "${NRF5_SDK_PATH}/modules/nrfx/drivers/include" "${NRF5_SDK_PATH}/modules/nrfx/hal" "${NRF5_SDK_PATH}/modules/nrfx/mdk" - ${NRF5_SDK_PATH}/external/freertos/source/include + "${NRF5_SDK_PATH}/external/freertos/source/include" "${NRF5_SDK_PATH}/components/toolchain/cmsis/include" "${NRF5_SDK_PATH}/components/libraries/atomic" "${NRF5_SDK_PATH}/components/libraries/atomic_fifo" -- cgit v0.10.2 From f907fcbe614690fdffe2b27bcd1526c0f1d10b36 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 23:42:46 +0200 Subject: Added Clang Format rules diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..e735549 --- /dev/null +++ b/.clang-format @@ -0,0 +1,136 @@ +--- +Language: Cpp +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: true +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: true + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 140 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: true +DeriveLineEnding: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + - Regex: '.*' + Priority: 1 + SortPriority: 0 +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: true +IndentGotoLabels: true +IndentPPDirectives: BeforeHash +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: All +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatementsExceptForEachMacros +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +# Needs new Clang: SpaceAroundPointerQualifiers: After +Standard: Latest +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +... -- cgit v0.10.2 From 9be9ddca45c46969f0308271cb78667617fc8bb7 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 30 Jan 2021 23:50:40 +0200 Subject: Improve CLion's formatting rules diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 7bdfbcb..33a4a04 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -8,10 +8,30 @@