Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
Go to file
Yusuf Ebrahim a40168a9d7
New dice-rolling app: InfiniDice! (#1326)
Add new App `Dice.h` to randomly roll the dice(s).
The number of dice can range from 1-9 (default 1), and the sides can
range from d2-d99 (default d2).

To have a haptic feedback we make Dice vibrate on roll.

Regarding the use of C++ `<random>` library:
There are known problems with `rand()` and `srand()` (see https://en.cppreference.com/w/cpp/numeric/random/rand)
and the `<random>` library is preferred for this reason. The function used from
`<random>` also avoids a very rare bias that would occur using `rand()` and modulo,
when `RAND_MAX` is not a multiple of `d` and the initially generated number falls in
the last "short" segment. This commit also updates the seed to derive entropy
(via `seed_seq`) from a mix of the system tick count and the x,y,z components of the
PineTime motion controller -- taking inspiration from and with credit to @w4tsn
(https://github.com/InfiniTimeOrg/InfiniTime/pull/1199)

Thanks for suggestions:
* in Dice, when rolling 1d2, also show "HEADS" or "TAILS" -- suggestion by @medeyko
* ui adjustments and result realignment -- suggestion by @Boteium

---------

Co-authored-by: NeroBurner <pyro4hell@gmail.com>
Co-authored-by: Riku Isokoski <riksu9000@gmail.com>
Co-authored-by: Paul Weiß <45500341+Poohl@users.noreply.github.com>
Co-authored-by: FintasticMan <finlay.neon.kid@gmail.com>
2024-01-23 09:45:52 +01:00
.devcontainer lv_img_conv_py: minimal python port of node module 2023-10-26 22:45:01 +02:00
.github CI: install build resource dependency python3-pil package 2023-10-26 22:45:01 +02:00
.idea/codeStyles Improved CLion configuration 2021-07-02 16:29:09 +02:00
.vscode Update VS Code config to C++20 2023-12-10 12:02:42 +01:00
bootloader Fix markdown format with autoformatter (#1284) 2022-08-21 14:50:09 +03:00
cmake-nRF5x Remove CMake targets and corresponding CLI arguments that are specific to the debugging environment (USE_JLINK, USE_OPENOCD and USE_GDB_CLIENT). 2022-09-17 21:25:54 +02:00
doc CMake watch faces selection 2024-01-06 14:44:10 +01:00
docker docker: Install Node.js in a non-deprecated way (#1849) 2023-11-12 14:09:41 +01:00
hooks hook: Find correct clang-format version better 2024-01-12 14:42:53 +01:00
src New dice-rolling app: InfiniDice! (#1326) 2024-01-23 09:45:52 +01:00
tests Update clang-{format,tidy} to 14 2023-01-04 17:15:33 +01:00
tools Allow mcuboot tool to use cbor2 additional to cbor 2023-06-04 19:46:37 +02:00
.clang-format clang-format: Always break template declarations 2023-02-16 09:13:58 +02:00
.clang-tidy Update clang-tidy configuration and fix some warnings (#1474) 2022-12-18 18:14:36 +01:00
.gitattributes Create .gitattributes 2021-01-30 18:52:14 +02:00
.gitconfig Create .gitconfig 2021-01-30 18:48:06 +02:00
.gitignore clangd: Add clangd cache directory to gitignore (#1763) 2023-05-27 20:24:17 +02:00
.gitmodules arduinofft: Move to submodule, define srqt_internal externally 2023-06-17 17:46:48 +02:00
.gitpod.yml Custom Dockerfile for gitpod.io 2021-01-05 00:34:15 +00:00
CMakeLists.txt Set version to 1.14.0 2024-01-06 15:21:29 +01:00
CONTRIBUTING.md branches: Update files to refer to main instead of develop 2023-03-02 09:45:47 +02:00
gcc_nrf52-mcuboot.ld Update gcc_nrf52-mcuboot.ld 2022-12-27 09:58:51 +13:00
gcc_nrf52.ld Linker script: Update gcc_nrf52.ld to reflect changes done in gcc_nrf52-mcuboot.ld. 2023-01-29 12:38:05 +01:00
LICENSE Add LICENSE file and information. 2020-08-02 17:38:51 +02:00
nrf_common.ld Fix link error because of missing file "nrf_common.ld" 2020-01-12 16:26:20 +01:00
nrf52.svd Fix various typos 2022-06-05 09:31:23 +03:00
README.md Remove 'Looking for Maintainer' 2023-12-27 20:59:57 +01:00

InfiniTime

InfiniTime logo

Fast open-source firmware for the PineTime smartwatch with many features, written in modern C++.

New to InfiniTime?

Companion apps

Note: We removed mentions to NRFConnect as this app is closed source and recent versions do not work anymore with InfiniTime (the last version known to work is 4.24.3). If you used NRFConnect in the past, we recommend you switch to Gadgetbridge.

Development

Contributing

Build, flash and debug

API

Architecture and technical topics

Project management

Licenses

This project is released under the GNU General Public License version 3 or, at your option, any later version.

It integrates the following projects:

Credits

Im not working alone on this project. First, many people create pull requests for this project. Then, there is the whole #pinetime community: a lot of people all around the world who are hacking, searching, experimenting and programming the Pinetime. We exchange our ideas, experiments and code in the chat rooms and forums.

Here are some people I would like to highlight:

  • Atc1441: He works on an Arduino based firmware for the Pinetime and many other smartwatches based on similar hardware. He was of great help when I was implementing support for the BMA421 motion sensor and I²C driver.
  • Koen: Hes working on a firmware based on RiotOS. He integrated similar libs as me: NimBLE, LittleVGL,… His help was invaluable too!
  • Lup Yuen Lee: He is everywhere: he works on a Rust firmware, builds a MCUBoot based bootloader for the Pinetime, designs a Flutter based companion app for smartphones and writes a lot of articles about the Pinetime!