Skip to content

Commit cdf99b0

Browse files
committed
Revert "Merge upstream"
This reverts commit 1d43adc.
1 parent 1d43adc commit cdf99b0

33 files changed

Lines changed: 232 additions & 300 deletions

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ name: Build PineTime Firmware
99
# When to run this Workflow...
1010
on:
1111

12-
# Run this Workflow when files are updated (Pushed) in the "master" and "develop" Branch
12+
# Run this Workflow when files are updated (Pushed) in the "master" Branch
1313
push:
14-
branches: [ master, develop ]
14+
branches: [ master ]
1515

16-
# Also run this Workflow when a Pull Request is created or updated in the "master" and "develop" Branch
16+
# Also run this Workflow when a Pull Request is created or updated in the "master" Branch
1717
pull_request:
18-
branches: [ master, develop ]
18+
branches: [ master ]
1919

2020
# Steps to run for the Workflow
2121
jobs:

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ if(BUILD_DFU)
5151
set(BUILD_DFU true)
5252
endif()
5353

54-
option(WATCH_COLMI_P8 "Build for the Colmi P8" OFF)
55-
set(TARGET_DEVICE "PineTime")
56-
57-
if(WATCH_COLMI_P8)
58-
set(TARGET_DEVICE "Colmi P8")
59-
add_definitions(-DWATCH_P8)
60-
endif()
61-
6254
set(PROJECT_GIT_COMMIT_HASH "")
6355

6456
execute_process(COMMAND git rev-parse --short HEAD
@@ -76,7 +68,6 @@ message(" * Version : " ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${P
7668
message(" * Toolchain : " ${ARM_NONE_EABI_TOOLCHAIN_PATH})
7769
message(" * GitRef(S) : " ${PROJECT_GIT_COMMIT_HASH})
7870
message(" * NRF52 SDK : " ${NRF5_SDK_PATH})
79-
message(" * Target device : " ${TARGET_DEVICE})
8071
set(PROGRAMMER "???")
8172
if(USE_JLINK)
8273
message(" * Programmer/debugger : JLINK")

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# InfiniTime
1+
# PineTime
22

33
[![Build PineTime Firmware](https://github.com/JF002/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/JF002/InfiniTime/actions)
44

5+
> 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.
6+
7+
> We envision the PineTime as a companion for not only your PinePhone but also for your favorite devices — any phone, tablet, or even PC.
8+
9+
*https://www.pine64.org/pinetime/*
10+
11+
The **Pinetime** smartwatch is built around the NRF52832 MCU (512KB Flash, 64KB RAM), a 240*240 LCD display driven by the ST7789 controller, an accelerometer, a heart rate sensor, and a vibration motor.
12+
13+
# InfiniTime
14+
515
![InfiniTime logo](images/infinitime-logo.jpg "InfiniTime Logo")
616

7-
The goal of this project is to design an open-source firmware for the [Pinetime smartwatch](https://www.pine64.org/pinetime/) :
17+
The goal of this project is to design an open-source firmware for the Pinetime smartwatch :
818

919
- Code written in **modern C++**;
1020
- Build system based on **CMake**;
1121
- Based on **[FreeRTOS 10.0.0](https://freertos.org)** real-time OS.
1222
- Using **[LittleVGL/LVGL 7](https://lvgl.io/)** as UI library...
1323
- ... and **[NimBLE 1.3.0](https://github.com/apache/mynewt-nimble)** as BLE stack.
1424

15-
## New to InfiniTime?
16-
17-
- [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md)
18-
- [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md)
19-
2025
## Overview
2126

2227
![Pinetime screens](images/1.0.0/collage.png "PinetimeScreens")
@@ -65,12 +70,16 @@ As of now, here is the list of achievements of this project:
6570
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)
6671
* [Siglo](https://github.com/alexr4535/siglo) (on Linux)
6772
* **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY)
68-
* **[Experimental]** [Infini-iOS](https://github.com/xan-m/Infini-iOS) (on iOS)
6973
- OTA (Over-the-air) update via BLE
7074
- [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/)
7175

7276
## Documentation
7377

78+
### Getting started
79+
80+
- [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md)
81+
- [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md)
82+
7483
### Develop
7584

7685
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)

cmake-nRF5x/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The script makes use of the following tools:
9898

9999
After setup you can use cmake as usual:
100100

101-
1. Generate the actual build files (out-of-source builds are strongly recommended):
101+
1. Generate the actual build files (out-of-source builds are strongly recomended):
102102

103103
```commandline
104104
cmake -H. -B"cmake-build" -G "Unix Makefiles"

doc/buildAndProgram.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CMake configures the project according to variables you specify the command line
2828
**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`
2929
**GDB_CLIENT_TARGET_REMOTE**|Target remote connection string. Used only if `USE_GDB_CLIENT` is 1.|`-DGDB_CLIENT_TARGET_REMOTE=/dev/ttyACM0`
3030
**BUILD_DFU (\*\*)**|Build DFU files while building (needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil)).|`-DBUILD_DFU=1`
31-
**WATCH_COLMI_P8**|Use pin configuration for Colmi P8 watch|`-DWATCH_COLMI_P8=1`
3231

3332
####(**) Note about **CMAKE_BUILD_TYPE**:
3433
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.

doc/gettingStarted/ota-gadgetbridge-nrfconnect.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Read carefully the warning and tap **Install**:
4747

4848
Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime!
4949

50-
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
51-
5250
![Gadgetbridge 5](gadgetbridge5.jpg)
5351

5452
### Using NRFConnect
@@ -66,8 +64,6 @@ Select **Distribution packet (ZIP)**:
6664

6765
Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime!
6866

69-
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
70-
7167
![NRFConnect 3](nrfconnect3.jpg)
7268

7369
## How to flash InfiniTime using the SWD interface
@@ -92,10 +88,6 @@ If you are using OpenOCD with a STLinkV2, you can find more info [on this page](
9288
### Using Gadgetbridge
9389
Good news! Gadgetbridge **automatically** synchronizes the time when connecting to your PineTime!
9490

95-
### Using any Chromium-based web browser
96-
You can use it from your PC, Mac, Android. Browsers now have BLE support.
97-
https://hubmartin.github.io/WebBLEWatch/
98-
9991
### Using NRFConnect
10092
You must enable the **CTS** *GATT server* into NRFConnect so that InfiniTime can synchronize the time with your smartphone.
10193

doc/versioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ The versioning of this project is based on [Semantic versionning](https://semver
33

44
- The **patch** is incremented when we fix a bug on a **released** version (most of the time using a **hotfix** branch).
55
- The **minor** is incremented when we release a new version with new features. It corresponds to a merge of **develop** into **master**.
6-
- The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. For now, I suggest that it stays **0** until we have a fully functioning firmware suited for the final user.
6+
- The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. For now, I suggest that it stays **0** until we have a fully functionning firmware suited for the final user.

src/CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ set(SDK_SOURCE_FILES
9292
set(TINYCRYPT_SRC
9393
libs/mynewt-nimble/ext/tinycrypt/src/aes_encrypt.c
9494
libs/mynewt-nimble/ext/tinycrypt/src/utils.c
95-
libs/mynewt-nimble/ext/tinycrypt/src/cmac_mode.c
96-
libs/mynewt-nimble/ext/tinycrypt/src/ecc.c
97-
libs/mynewt-nimble/ext/tinycrypt/src/ecc_dh.c
9895
)
9996

10097
set(NIMBLE_SRC
@@ -107,10 +104,6 @@ set(NIMBLE_SRC
107104
libs/mynewt-nimble/nimble/host/src/ble_l2cap.c
108105
libs/mynewt-nimble/nimble/host/src/ble_hs_mbuf.c
109106
libs/mynewt-nimble/nimble/host/src/ble_sm.c
110-
libs/mynewt-nimble/nimble/host/src/ble_sm_cmd.c
111-
libs/mynewt-nimble/nimble/host/src/ble_sm_lgcy.c
112-
libs/mynewt-nimble/nimble/host/src/ble_sm_alg.c
113-
libs/mynewt-nimble/nimble/host/src/ble_sm_sc.c
114107
libs/mynewt-nimble/nimble/host/src/ble_gap.c
115108
libs/mynewt-nimble/nimble/host/src/ble_gatts.c
116109
libs/mynewt-nimble/nimble/host/src/ble_gattc.c
@@ -134,6 +127,10 @@ set(NIMBLE_SRC
134127
libs/mynewt-nimble/nimble/host/src/ble_hs_atomic.c
135128
libs/mynewt-nimble/nimble/host/src/ble_hs_adv.c
136129
libs/mynewt-nimble/nimble/host/src/ble_hs_flow.c
130+
libs/mynewt-nimble/nimble/host/src/ble_sm.c
131+
libs/mynewt-nimble/nimble/host/src/ble_sm_cmd.c
132+
libs/mynewt-nimble/nimble/host/src/ble_sm_lgcy.c
133+
libs/mynewt-nimble/nimble/host/src/ble_sm_alg.c
137134
libs/mynewt-nimble/nimble/host/src/ble_hs_mqueue.c
138135
libs/mynewt-nimble/nimble/host/src/ble_hs_stop.c
139136
libs/mynewt-nimble/nimble/host/src/ble_hs_startup.c
@@ -628,7 +625,6 @@ set(INCLUDE_FILES
628625
drivers/DebugPins.h
629626
drivers/InternalFlash.h
630627
drivers/Hrs3300.h
631-
drivers/PinMap.h
632628
drivers/Bma421.h
633629
drivers/Bma421_C/bma4.c
634630
drivers/Bma421_C/bma423.c

src/components/battery/BatteryController.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "BatteryController.h"
2-
#include "drivers/PinMap.h"
32
#include <hal/nrf_gpio.h>
43
#include <nrfx_saadc.h>
54
#include <algorithm>
@@ -10,12 +9,15 @@ Battery* Battery::instance = nullptr;
109

1110
Battery::Battery() {
1211
instance = this;
13-
nrf_gpio_cfg_input(PinMap::Charging, static_cast<nrf_gpio_pin_pull_t> GPIO_PIN_CNF_PULL_Disabled);
12+
}
13+
14+
void Battery::Init() {
15+
nrf_gpio_cfg_input(chargingPin, static_cast<nrf_gpio_pin_pull_t> GPIO_PIN_CNF_PULL_Pullup);
1416
}
1517

1618
void Battery::Update() {
17-
isCharging = !nrf_gpio_pin_read(PinMap::Charging);
18-
isPowerPresent = !nrf_gpio_pin_read(PinMap::PowerPresent);
19+
isCharging = !nrf_gpio_pin_read(chargingPin);
20+
isPowerPresent = !nrf_gpio_pin_read(powerPresentPin);
1921

2022
if (isReading) {
2123
return;
@@ -73,11 +75,5 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
7375

7476
nrfx_saadc_uninit();
7577
isReading = false;
76-
77-
systemTask->PushMessage(System::Messages::BatteryMeasurementDone);
7878
}
7979
}
80-
81-
void Battery::Register(Pinetime::System::SystemTask* systemTask) {
82-
this->systemTask = systemTask;
83-
}

src/components/battery/BatteryController.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#pragma once
22
#include <cstdint>
33
#include <drivers/include/nrfx_saadc.h>
4-
#include <systemtask/SystemTask.h>
4+
#include <array>
5+
#include <numeric>
56

67
namespace Pinetime {
78
namespace Controllers {
@@ -10,8 +11,8 @@ namespace Pinetime {
1011
public:
1112
Battery();
1213

14+
void Init();
1315
void Update();
14-
void Register(System::SystemTask* systemTask);
1516

1617
uint8_t PercentRemaining() const {
1718
return percentRemaining;
@@ -33,6 +34,8 @@ namespace Pinetime {
3334
static Battery* instance;
3435
nrf_saadc_value_t saadc_value;
3536

37+
static constexpr uint32_t chargingPin = 12;
38+
static constexpr uint32_t powerPresentPin = 19;
3639
static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7;
3740
uint16_t voltage = 0;
3841
uint8_t percentRemaining = 0;
@@ -46,8 +49,6 @@ namespace Pinetime {
4649
static void AdcCallbackStatic(nrfx_saadc_evt_t const* event);
4750

4851
bool isReading = false;
49-
50-
Pinetime::System::SystemTask* systemTask = nullptr;
5152
};
5253
}
5354
}

0 commit comments

Comments
 (0)