Skip to content

Commit 24d3eea

Browse files
JF002Gitea
authored andcommitted
Merge branch 'develop' of JF/PineTime into master
2 parents 5cd4b36 + 9f9d0eb commit 24d3eea

46 files changed

Lines changed: 1769 additions & 469 deletions

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GitHub Actions Workflow to build FreeRTOS Firmware for PineTime Smart Watch
22
# See https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
3-
# Based on https://github.com/JF002/Pinetime/blob/master/doc/buildAndProgram.md
4-
# and https://github.com/JF002/Pinetime/blob/master/bootloader/README.md
3+
# Based on https://github.com/JF002/InfiniTime/blob/master/doc/buildAndProgram.md
4+
# and https://github.com/JF002/InfiniTime/blob/master/bootloader/README.md
55

66
# Name of this Workflow
77
name: Build PineTime Firmware

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"chrono": "cpp"
4+
}
5+
}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
2-
project(pinetime VERSION 0.14.1 LANGUAGES C CXX ASM)
2+
project(pinetime VERSION 0.15.0 LANGUAGES C CXX ASM)
33

44
set(NRF_TARGET "nrf52")
55

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# PineTime
33

4-
![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)
4+
![Build PineTime Firmware](https://github.com/JF002/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)
55

66
> The PineTime is a free and open source smartwatch capable of running custom-built open operating systems. Some of the notable features include a heart rate monitor, a week-long battery as well as a capacitive touch IPS display that is legible in direct sunlight. It is a fully community driven side-project, which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship.
77
@@ -44,6 +44,7 @@ As of now, here is the list of achievements of this project:
4444
* Notification (displays the last notification received)
4545
* Paddle (single player pong-like game)
4646
* Two (2048 clone game)
47+
* Stopwatch (with all the necessary functions such as play, pause, lap, stop)
4748
- Supported by 2 companion apps (development is in progress):
4849
* [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android)
4950
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)

doc/buildAndProgram.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ To build this project, you'll need:
88
## Build steps
99
### Clone the repo
1010
```
11-
git clone https://github.com/JF002/Pinetime.git
12-
cd Pinetime
11+
git clone https://github.com/JF002/InfiniTime.git
12+
cd InfiniTime
1313
git submodule update --init
1414
mkdir build
1515
cd build
@@ -22,18 +22,23 @@ CMake configures the project according to variables you specify the command line
2222
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`-DARM_NONE_EABI_TOOLCHAIN_PATH=/home/jf/nrf52/gcc-arm-none-eabi-9-2020-q2-update/`|
2323
**NRF5_SDK_PATH**|path to the NRF52 SDK|`-DNRF5_SDK_PATH=/home/jf/nrf52/Pinetime/sdk`|
2424
**USE_JLINK, USE_GDB_CLIENT and USE_OPENOCD**|Enable *JLink* mode, *GDB Client* (Black Magic Probe) mode or *OpenOCD* mode (set the one you want to use to `1`)|`-DUSE_JLINK=1`
25-
**CMAKE_BUILD_TYPE**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug`
25+
**CMAKE_BUILD_TYPE (\*)**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug`
2626
**NRFJPROG**|Path to the NRFJProg executable. Used only if `USE_JLINK` is 1.|`-DNRFJPROG=/opt/nrfjprog/nrfjprog`
2727
**GDB_CLIENT_BIN_PATH**|Path to arm-none-eabi-gdb executable. Used only if `USE_GDB_CLIENT` is 1.|`-DGDB_CLIENT_BIN_PATH=/home/jf/nrf52/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gdb`
2828
**GDB_CLIENT_TARGET_REMOTE**|Target remote connection string. Used only if `USE_GDB_CLIENT` is 1.|`-DGDB_CLIENT_TARGET_REMOTE=/dev/ttyACM0`
29-
**BUILD_DFU (\*)**|Build DFU files while building (needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil)).|`-BUILD_DFU=1`
29+
**BUILD_DFU (\*\*)**|Build DFU files while building (needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil)).|`-BUILD_DFU=1`
3030

31-
####(*) Note about **BUILD_DFU**:
31+
####(**) Note about **CMAKE_BUILD_TYPE**:
32+
By default, this variable is set to *Release*. It compiles the code with size and speed optimizations. We use this value for all the binaries we publish when we [release](https://github.com/JF002/InfiniTime/releases) new versions of InfiniTime.
33+
34+
The *Debug* mode disables all optimizations, which makes the code easier to debug. However, the binary size will likely be too big to fit in the internal flash memory. If you want to build and debug a *Debug* binary, you'll need to disable some parts of the code. For example, the icons for the **Navigation** app use a lot of memory space. You can comment the content of `m_iconMap` in the [Navigation](https://github.com/JF002/InfiniTime/blob/develop/src/displayapp/screens/Navigation.h#L148) application to free some memory.
35+
36+
####(**) Note about **BUILD_DFU**:
3237
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mecanism. To generate the DFU file, the Python tool [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) is needed on your system. Check that this tool is properly installed before enabling this option.
3338

3439
#### CMake command line for JLink
3540
```
36-
cmake -DCMAKE_BUILD_TYPE=Debug -DARM_NONE_EABI_TOOLCHAIN_PATH=... -DNRF5_SDK_PATH=... -DUSE_JLINK=1 -DNRFJPROG=... ../
41+
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=... -DNRF5_SDK_PATH=... -DUSE_JLINK=1 -DNRFJPROG=... ../
3742
```
3843

3944
#### CMake command line for GDB Client (Black Magic Probe)
@@ -57,7 +62,7 @@ During the project generation, CMake created the following targets:
5762
- **pinetime-mcuboot-recovery** : build pinetime-recovery with bootloader support
5863
- **pinetime-mcuboot-recovery-loader** : build pinetime-recovery-loader with bootloader support
5964

60-
If you just want to build the project and run it on the Pinetime, using *pinetime-app* is recommanded. See [this page](../bootloader/README.md) for more info about bootloader support.
65+
If you just want to build the project and run it on the Pinetime, using *pinetime-app* is recommended. See [this page](../bootloader/README.md) for more info about bootloader support.
6166

6267
Build:
6368
```

doc/contribute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to contribute?
22
## Report bugs
3-
You use your Pinetime and find a bug in the firmware? [Create an issue on Github](https://github.com/JF002/Pinetime/issues) explaining the bug, how to reproduce it, the version of the firmware you use...
3+
You use your Pinetime and find a bug in the firmware? [Create an issue on Github](https://github.com/JF002/InfiniTime/issues) explaining the bug, how to reproduce it, the version of the firmware you use...
44
## Write and improve documentation
55
Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
66

@@ -41,4 +41,4 @@ The most important rule to follow is to try to keep the code as easy to read and
4141
- **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`)
4242
- **Includes** :
4343
- files from the project : `#include "relative/path/to/the/file.h"`
44-
- external files and std : `#include <file.h>`
44+
- external files and std : `#include <file.h>`

doc/filesInReleaseNotes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Using the releases
2-
For each new *stable* version of Pinetime, a [release note](https://github.com/JF002/Pinetime/releases) is created. It contains a description of the main changes in the release and some files you can use to flash the firmware in your Pinetime.
2+
For each new *stable* version of Pinetime, a [release note](https://github.com/JF002/InfiniTime/releases) is created. It contains a description of the main changes in the release and some files you can use to flash the firmware in your Pinetime.
33

44
This page describes the files from the release notes and how to use them.
55

6-
**NOTE :** the files included in different could be different. This page describes the release note of [version 0.7.1](https://github.com/JF002/Pinetime/releases/tag/0.7.1), which is the version that'll probably be pre-programmed at the factory for the next batch of Pinetime devkits.
6+
**NOTE :** the files included in different could be different. This page describes the release note of [version 0.7.1](https://github.com/JF002/InfiniTime/releases/tag/0.7.1), which is the version that'll probably be pre-programmed at the factory for the next batch of Pinetime devkits.
77

88
## Files included in the release note
99

doc/gettingStarted/gettingStarted.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you just want to flash or upgrade InfiniTime on your PineTime, this page is f
88
- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface)
99

1010
## InfiniTime releases and versions
11-
All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/JF002/Pinetime/releases).
11+
All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/JF002/InfiniTime/releases).
1212

1313
Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version.
1414

@@ -98,4 +98,4 @@ Launch NRFConnect, tap the sandwish button on the top left and select *Configure
9898

9999
Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established!
100100

101-
![NRFConnect CTS 1](nrfconnectcts1.jpg)
101+
![NRFConnect CTS 1](nrfconnectcts1.jpg)

src/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ list(APPEND SOURCE_FILES
485485
displayapp/screens/Meter.cpp
486486
displayapp/screens/InfiniPaint.cpp
487487
displayapp/screens/Paddle.cpp
488+
displayapp/screens/StopWatch.cpp
488489
displayapp/screens/BatteryIcon.cpp
489490
displayapp/screens/BleIcon.cpp
490491
displayapp/screens/NotificationIcon.cpp
@@ -499,6 +500,15 @@ list(APPEND SOURCE_FILES
499500
displayapp/screens/Notifications.cpp
500501
displayapp/screens/Twos.cpp
501502
displayapp/screens/HeartRate.cpp
503+
504+
## Watch faces
505+
displayapp/icons/bg_clock.c
506+
displayapp/screens/WatchFaceAnalog.cpp
507+
508+
displayapp/screens/WatchFaceDigital.cpp
509+
510+
##
511+
502512
main.cpp
503513
drivers/St7789.cpp
504514
drivers/SpiNorFlash.cpp
@@ -528,6 +538,7 @@ list(APPEND SOURCE_FILES
528538
components/ble/HeartRateService.cpp
529539
components/firmwarevalidator/FirmwareValidator.cpp
530540
components/motor/MotorController.cpp
541+
components/settings/Settings.cpp
531542
drivers/Cst816s.cpp
532543
FreeRTOS/port.c
533544
FreeRTOS/port_cmsis_systick.c
@@ -581,6 +592,7 @@ list(APPEND RECOVERY_SOURCE_FILES
581592
components/ble/NavigationService.cpp
582593
components/ble/HeartRateService.cpp
583594
components/firmwarevalidator/FirmwareValidator.cpp
595+
components/settings/Settings.cpp
584596
drivers/Cst816s.cpp
585597
FreeRTOS/port.c
586598
FreeRTOS/port_cmsis_systick.c
@@ -633,6 +645,7 @@ set(INCLUDE_FILES
633645
displayapp/screens/Tile.h
634646
displayapp/screens/Meter.h
635647
displayapp/screens/InfiniPaint.h
648+
displayapp/screens/StopWatch.h
636649
displayapp/screens/Paddle.h
637650
displayapp/screens/DropDownDemo.h
638651
displayapp/screens/BatteryIcon.h
@@ -671,7 +684,8 @@ set(INCLUDE_FILES
671684
components/ble/ImmediateAlertService.h
672685
components/ble/ServiceDiscovery.h
673686
components/ble/BleClient.h
674-
components/ble/HeartRateService.h.h
687+
components/ble/HeartRateService.h
688+
components/settings/Settings.h
675689
drivers/Cst816s.h
676690
FreeRTOS/portmacro.h
677691
FreeRTOS/portmacro_cmsis.h

src/components/datetime/DateTimeController.cpp

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,123 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
6464
second = time.seconds().count();
6565
}
6666

67+
const char *DateTime::MonthShortToString() {
68+
return DateTime::MonthsString[(uint8_t)month];
69+
}
70+
71+
const char *DateTime::MonthShortToStringLow() {
72+
return DateTime::MonthsStringLow[(uint8_t)month];
73+
}
74+
75+
const char *DateTime::MonthsToStringLow() {
76+
return DateTime::MonthsLow[(uint8_t)month];
77+
}
78+
79+
const char *DateTime::DayOfWeekToString() {
80+
return DateTime::DaysString[(uint8_t)dayOfWeek];
81+
}
82+
83+
const char *DateTime::DayOfWeekShortToString() {
84+
return DateTime::DaysStringShort[(uint8_t)dayOfWeek];
85+
}
86+
87+
const char *DateTime::DayOfWeekToStringLow() {
88+
return DateTime::DaysStringLow[(uint8_t)dayOfWeek];
89+
}
90+
91+
const char *DateTime::DayOfWeekShortToStringLow() {
92+
return DateTime::DaysStringShortLow[(uint8_t)dayOfWeek];
93+
}
94+
95+
96+
char const *DateTime::DaysStringLow[] = {
97+
"--",
98+
"Monday",
99+
"Tuesday",
100+
"Wednesday",
101+
"Thursday",
102+
"Friday",
103+
"Saturday",
104+
"Sunday"
105+
};
106+
107+
char const *DateTime::DaysStringShortLow[] = {
108+
"--",
109+
"Mon",
110+
"Tue",
111+
"Wed",
112+
"Thu",
113+
"Fri",
114+
"Sat",
115+
"Sun"
116+
};
117+
118+
char const *DateTime::DaysStringShort[] = {
119+
"--",
120+
"MON",
121+
"TUE",
122+
"WED",
123+
"THU",
124+
"FRI",
125+
"SAT",
126+
"SUN"
127+
};
128+
129+
char const *DateTime::DaysString[] = {
130+
"--",
131+
"MONDAY",
132+
"TUESDAY",
133+
"WEDNESDAY",
134+
"THURSDAY",
135+
"FRIDAY",
136+
"SATURDAY",
137+
"SUNDAY"
138+
};
139+
140+
char const *DateTime::MonthsString[] = {
141+
"--",
142+
"JAN",
143+
"FEB",
144+
"MAR",
145+
"APR",
146+
"MAY",
147+
"JUN",
148+
"JUL",
149+
"AUG",
150+
"SEP",
151+
"OCT",
152+
"NOV",
153+
"DEC"
154+
};
155+
156+
char const *DateTime::MonthsStringLow[] = {
157+
"--",
158+
"Jan",
159+
"Feb",
160+
"Mar",
161+
"Apr",
162+
"May",
163+
"Jun",
164+
"Jul",
165+
"Aug",
166+
"Sep",
167+
"Oct",
168+
"Nov",
169+
"Dec"
170+
};
171+
172+
char const *DateTime::MonthsLow[] = {
173+
"--",
174+
"January",
175+
"February",
176+
"March",
177+
"April",
178+
"May",
179+
"June",
180+
"July",
181+
"August",
182+
"September",
183+
"October",
184+
"November",
185+
"December"
186+
};

0 commit comments

Comments
 (0)