Commit Graph

170 Commits

Author SHA1 Message Date
hubmartin
fc2241fbf4 Add wake on charge event 2021-10-08 16:53:49 +02:00
Riku Isokoski
f61e88b842 Merge branch 'develop' into update_touch_driver 2021-10-05 12:45:03 +03:00
Riku Isokoski
a9f7153fdf Improve battery percentage calculation and reporting
While charging, percentage should only go up, and while discharging,
percentage should only go down.
2021-10-04 01:41:38 +03:00
hubmartin
9ef1babb9d Code cleanup 2021-10-03 17:03:08 +02:00
hubmartin
f5725714d1 Call battery controller update 2021-10-03 17:00:38 +02:00
hubmartin
2aebbe3f47 GPIOTE fix of button and power detection experiment 2021-10-03 16:47:01 +02:00
JF002
8a2b86dc83
Merge pull request #664 from Riksu9000/disable_notif_only
Toggle notifications only, keep vibrations.
2021-09-23 20:13:42 +02:00
Riku Isokoski
e468acc99e
Merge branch 'develop' into update_touch_driver 2021-09-18 19:22:59 +03:00
Jean-François Milants
f556003de3 Merge branch 'PersistantStorage' of git://github.com/geekbozu/InfiniTime into geekbozu-PersistantStorage
# Conflicts:
#	src/systemtask/SystemTask.cpp
2021-09-18 17:37:37 +02:00
Mark Russell
b9e56843a2 resolve conflict in src/systemtask/Messages.h 2021-09-16 16:20:39 -04:00
Mark Russell
cdf99b08f4 Revert "Merge upstream"
This reverts commit 1d43adcdfa.
2021-09-16 16:12:20 -04:00
Mark Russell
1d43adcdfa Merge upstream 2021-09-16 16:01:25 -04:00
Mark Russell
f857a757a7 Fixes per Riksu9000's feedback 2021-09-16 15:38:31 -04:00
Riku Isokoski
93d240a23b
Merge branch 'develop' into disable_notif_only 2021-09-14 23:38:42 +03:00
Riku Isokoski
f221f5d744 Merge branch 'develop' into update_touch_driver 2021-09-14 15:34:09 +03:00
Mark Russell
bfe13d9d68 Fixes based on code reviews (formatting, UI code) 2021-09-13 15:26:28 -04:00
Riku Isokoski
40765f1173
Merge branch 'develop' into disable_notif_only 2021-09-13 21:22:53 +03:00
Jean-François Milants
9afa412a2a Merge branch 'refactor_adv' of https://github.com/evergreen22/InfiniTime into evergreen22-refactor_adv
# Conflicts:
#	src/components/ble/NimbleController.cpp
2021-09-13 20:22:27 +02:00
JF002
b0bdd2be1c
Merge pull request #549 from hubmartin/pinmap
Put all duplicated GPIO pin definitions to a single file
2021-09-13 20:05:43 +02:00
Tim Gates
84a93b5441
docs: Fix a few typos (#606)
* docs: Fix a few typos

There are small typos in:
- doc/versioning.md
- src/components/ble/NimbleController.cpp
- src/libs/mynewt-nimble/CODING_STANDARDS.md
- src/libs/mynewt-nimble/docs/btshell/btshell_GAP.rst
- src/systemtask/SystemTask.cpp

Fixes:
- Should read `milliseconds` rather than `miliseconds`.
- Should read `unnecessary` rather than `uncesseray`.
- Should read `target` rather than `tharget`.
- Should read `project` rather than `projct`.
- Should read `preferred` rather than `prefered`.
- Should read `functioning` rather than `functionning`.
- Should read `forever` rather than `forver`.
- Should read `existing` rather than `exisiting`.
2021-09-13 20:02:53 +02:00
hubmartin
73d3e41cea Merge branch 'develop' into pinmap 2021-09-13 10:19:07 +02:00
Riku Isokoski
3ee4876214 Toggle notifications only, keep vibrations. 2021-09-12 11:08:25 +03:00
Mark Russell
1fb5757655 Created basic alarm app 2021-09-10 18:40:13 -04:00
James A. Jerkins
22571d4b38 Advertise fast for at least 30 secs then slow down
On power up, advertise aggressively for at least 30 seconds then switch
to a longer interval to conserve battery life. This fast/slow pattern
is designed to balance connection response time and battery life.

When a disconnect event is received restart the fast/slow pattern.

When a failed connect event is received, restart the fast/slow pattern.

When the screen is activated and ble is not connected, restart the fast/slow pattern.

This pattern is consistent with Apple's BLE developer standards (QA 1931).
2021-09-05 15:53:20 -05:00
Riku Isokoski
21d37d1e23 Merge remote-tracking branch 'upstream/develop' into timer_battery_reading 2021-08-30 10:15:19 +03:00
James A. Jerkins
be31f417db WIP Refactor ble advertising
Refactor ble advertising based on ble standards and conventions.
Changes are based on the bleprph example code, bluetooth docs, and nimble docs.
2021-08-29 15:50:04 -05:00
hubmartin
8390d0ef72 Merge branch 'develop' into pinmap 2021-08-29 11:43:50 +02:00
Jean-François Milants
6c023785e5 Fix wake on tap/double tap. 2021-08-28 21:30:31 +02:00
Riku Isokoski
d2d97319e0 Merge branch 'develop' into update_touch_driver 2021-08-28 17:19:49 +03:00
Riku Isokoski
085c9ab2e1 Merge branch 'develop' into timer_battery_reading 2021-08-28 16:54:40 +03:00
Jean-François Milants
0313277ae6 Fix touchinfo typo in SystemTask. 2021-08-28 15:10:14 +02:00
Jean-François Milants
45e7638fc2 Merge branch 'twimaster_rework' of https://github.com/Riksu9000/InfiniTime into Riksu9000-twimaster_rework
# Conflicts:
#	src/systemtask/SystemTask.cpp
2021-08-28 15:08:50 +02:00
hubmartin
2a299fe275 Merge branch 'develop' into pinmap 2021-08-22 22:11:57 +02:00
Tim Keller
4f6d7e2c63 Move Backup to the system task. 2021-08-19 00:51:12 +00:00
Riku Isokoski
85c99797da Merge branch 'develop' into new_touch_handler 2021-08-18 22:07:02 +03:00
Riku Isokoski
780a811f05 Automatic error detection 2021-08-18 15:23:30 +03:00
Riku Isokoski
5b969ccfa9 Merge branch 'develop' into update_touch_driver 2021-08-17 15:35:29 +03:00
Riku Isokoski
044036e884 Merge branch 'develop' into timer_battery_reading 2021-08-14 23:02:23 +03:00
Riku Isokoski
23bde0d18e Make battery reading periodic. Add events. Disable pullup 2021-08-14 21:18:11 +03:00
Riku Isokoski
6776776421 Make diff smaller and revert some changes in DisplayApp 2021-08-10 22:18:21 +03:00
Riku Isokoski
8a694adb09 Rework TouchHandler into not a task 2021-08-10 22:03:34 +03:00
Riku Isokoski
2194a339cf Only enable the bus when needed 2021-08-10 11:26:43 +03:00
hubmartin
b7aa04e1f5 PinMap with namespace and constexpr 2021-08-03 20:32:23 +02:00
hubmartin
28abeae21b DRAFT: Put gpio pins to separate file 2021-08-02 21:37:48 +02:00
Riku Isokoski
f9319dfb91 Remove leftover 2021-08-01 21:19:33 +03:00
Riku Isokoski
e6dcb3009f Improvements 2021-08-01 13:05:48 +03:00
Riku Isokoski
5bdef365f2 Merge branch 'develop' into HEAD 2021-08-01 11:47:26 +03:00
Riku Isokoski
a1ba187c47 Merge branch 'develop' into new_touch_handler 2021-07-25 20:01:09 +03:00
Riku Isokoski
34949a47c5
Dim screen before sleep (#464)
* Implement dimming
2021-07-24 20:29:10 +02:00
Riku Isokoski
d666c5004f
Merge branch 'develop' into new_touch_handler 2021-07-23 22:52:08 +03:00
Riku Isokoski
0a0f28fff4
Make firmware updating more foolproof (#469)
* Make firmware updating more foolproof and fix bugs
* No need to manually handle overflow
* Make startTime TickType_t
* Don't process TouchEvents::None
* Fix sleep getting re-enabled issue more directly
2021-07-22 21:57:45 +02:00
Riku Isokoski
3e42297bd8 Update 2021-07-18 12:32:46 +03:00
Riku Isokoski
93ccbf38e8 Fix touch wakeup and code cleanup 2021-07-16 01:49:20 +03:00
Riku Isokoski
2a3e126390 Fix most issues 2021-07-16 00:07:55 +03:00
Riku Isokoski
fe64176e7b New touch handler, with issues 2021-07-15 14:11:27 +03:00
Riku Isokoski
7ac6bdfe71 Merge branch 'develop' into update_touch_driver 2021-07-15 01:03:44 +03:00
Kozova1
57b3397078
Multiple wakeup sources (#290)
* Allow multiple wakeup modes at the same time.

This commit adds multiple wakeup modes support.
It does so by storing them as a uint8_t bitfield enum.
It changes the following functions:

Since multiple modes can be on now, older version would not cut it:
WakeUpMode getWakeupMode() -> std::bitset<3> getWakeUpModes()
Where each bit corresponds to a WakeUpMode

We still need a way to check whether a specific wakeup mode is on, so:
bool isWakeUpModeOn(const WakeUpMode mode)

This function was changed to work correctly with the new implementation.
setWakeUpMode(WakeupMode mode, bool enable)

Previously, systemtask would exit SystemTask::OnTouchEvent() if the wake
up mode was None or RaiseWrist, to prevent waking up when a touch was
received. However, after enabling using multiple WakeUpModes, this
caused a bug where when RaiseWrist was checked with SingleTap or
DoubleTap, the tap detection wouldn't work.

This commit fixes that bug.

Next commit will update the settings WakeUpMode select UI to reflect these changes.

Signed-off-by: Kozova1 <mug66kk@gmail.com>

* Updated UI to reflect multiple WakeUp sources being available.

Signed-off-by: Kozova1 <mug66kk@gmail.com>
2021-07-14 20:51:51 +02:00
Riku Isokoski
5bc40c9287 Update touchpad driver 2021-07-14 17:11:16 +03:00
Jean-François Milants
e21f6a7f41 Notify battery level every 10 minutes when connected to a BLE host.
Refactor battery percent : only use uint8_t to store the battery % remaining.
2021-07-11 16:55:06 +02:00
joaquim.org
084123b752
Using littlefs (#438)
* add submodule littlefs
* base fs
* Save settings using littlefs
* Small fixes and suggestions from PR
* More small fixes from PR suggestions
* Code clean up
* Change SpiNorFlash functions to be private in FS
2021-07-11 15:06:06 +02:00
Neil O'Fix
0045fb16b6
SPI flash sleep if bootloader >= 1.0.0 (#322)
* Retrieve and display bootloader version
- Display bootloader version on System Info screen
- Enable SPI flash sleep mode if bootloader version >= 1.0.0
* Wait for SPI flash to wakeup before starting OTA DFU
2021-06-26 20:53:32 +02:00
JF002
c6dca25b9f
Add support for BMA425 acceleration sensor. (#440)
* Add support for BMA425 acceleration sensor.
2021-06-19 20:27:59 +02:00
Jean-François Milants
6d524ebea2 Move most of the code from the constructor of the objects statically initialized in main() into Start()/Init() functions to avoid Static Initialization Order Fiasco (https://en.cppreference.com/w/cpp/language/siof). See https://github.com/JF002/InfiniTime/pull/415#issuecomment-859004238. 2021-06-12 10:58:28 +02:00
Jean-François Milants
b1925ff286 Minor improvements: use std::make_unique when creating unique_ptr, check the code is running from an IRQ before calling xQueueSendFromISR or xQueueSend) 2021-06-10 21:20:27 +02:00
Jean-François Milants
7f9cc51b05 Initialize SystemTask, DisplayApp and HeartRateTask as global static variable instead of variables on the heap. We don't need them on the heap as we know their size at build time, it'll reduce memory fragmentation and it'll make memory analysis easier. 2021-06-06 15:56:03 +02:00
Florian
13e3463276
Timer App (#355)
* built timer app

* Style improvements

* making sure buttons stay hidden when the app is reopened and reappear after the timer runs out

* more sensible calculations of time deltas. eliminated that mysterious scaling factor

* changing the timer icon
2021-05-20 20:43:54 +02:00
Jean-François Milants
9ab298c09e Fix wrong initialization of 'pinPowerPresent' pin that would prevent the touchpanel from working correctly when the device boots while connected to the charger. 2021-05-17 09:52:31 +02:00
David Ventura
9342d62a44
Emit event on power-present toggle (#320)
* Emit event on power-present toggle

* clang-format on changes

* also update battery status on any event

* update comments; remove double battery update

* Fix formatting

* Vibrate shortly on charging event

* debounce charge event
2021-05-16 21:13:22 +02:00
Florian Kraupa
56af4a0b83 cleaned up the code and reduced the size of the diff by removing things like additional whitespaces 2021-05-16 00:42:31 +02:00
Florian Kraupa
5da65494b3 only activate the timeout on call notification previews after they have been interacted with 2021-05-16 00:42:31 +02:00
Florian Kraupa
d13dd6dee3 implemented continuous vibration pattern for incoming calls 2021-05-16 00:42:31 +02:00
petter
6e1726d1d0 short vibration when enabling it 2021-05-02 11:48:05 +02:00
Avamander
6989854519 Changed access modified indentation 2021-04-24 12:00:45 +03:00
Avamander
40d45d923b Reformatted all the files according to clang-format style 2021-04-24 11:39:53 +03:00
Jean-François Milants
63635381b0 Disable the reading of the motion values in sleep mode when the wake up mode is not 'wrist rotation'. 2021-04-16 20:05:46 +02:00
Joaquim
3c413bdd52 In order to stabilize the battery reading,
I modified the process to make 5 consecutive readings,
as the process is asynchronous,
there is no interference in the main process.
2021-04-16 16:15:38 +01:00
Jean-François Milants
15b3b8e282 Merge branch 'develop' into motion-sensor
# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/Apps.h
#	src/displayapp/DisplayApp.cpp
#	src/displayapp/DisplayApp.h
#	src/displayapp/lv_pinetime_theme.c
#	src/displayapp/screens/ApplicationList.cpp
#	src/drivers/TwiMaster.cpp
#	src/systemtask/SystemTask.h
2021-04-09 21:16:21 +02:00
Jean-François Milants
9ac4be8b75 TwiMaster is now based on the NRFX TWI driver, as it handles more edge cases and workarounds for errors on the bus.
Reset the TWI bus after the soft-reset of the motion sensor to workaround issues on the TWI bus.
2021-04-08 20:07:24 +02:00
Joaquim
365e68e6cc Fix wake up lock in twi
optimize battery code
2021-04-05 15:22:10 +01:00
Joaquim José Almeida Pereira
96961709f3 array in SettingWakeUp wrong size 2021-04-05 11:01:44 +01:00
Jean-François Milants
1d7576de64 Reset the step count every day at midnight. 2021-04-04 15:56:40 +02:00
Jean-François Milants
52a90288fd Handle return code from BMA driver, and set a flag is the initialization fails. This allows to boot InfiniTime even if the device cannot initialize. 2021-04-04 15:56:11 +02:00
Jean-François Milants
c7cc47ae30 Code cleaning in BMA421 driver. Do the axis inversion in the driver and not in the application.
NOTE: Axis remapping from the SDK do not apply to the "raw" X/Y/Z values returned to the sensor. According to the doc, the remapping is only applied to features, but I cannot check if it has any effect on step counting (I'm not sure I use it correctly, doc is not complete enough about this feature).
2021-04-04 15:56:11 +02:00
Jean-François Milants
68bdaee1cc First integration of the motion sensor (bma 421) : step counting + wake on wrist rotation + app to see the value of the 3 axis in "real time". 2021-04-04 15:56:04 +02:00
Joaquim
bb7531e208 double tap wakeup error fix
battery nonblocking read
2021-04-04 13:51:22 +01:00
Joaquim
1d3742e14f Big UI and navigation Rewrite
new navigation
add some color to the apps
redesign menus
new settings menu
new quick settings
code clean up
size reduction by converting navigation images to font
and more...
2021-04-04 03:08:51 +01:00
Niall Cooling
8eb947a223 replaced all unique_ptr.reset calls with std::make_unique 2021-03-22 17:56:26 +00:00
Niall Cooling
e5e3fc02b8 Updated to include WatchFaceAnalog and fixed clashes 2021-03-22 17:23:49 +00:00
Jean-François Milants
405c85c160 Merge branch 'develop' of github.com:JF002/Pinetime into develop
# Conflicts:
#	src/main.cpp
#	src/systemtask/SystemTask.h
2021-03-20 11:41:49 +01:00
Niall Cooling
14bd790701 Resolved C++14 Cmake build issues so correctly building to C99/C++14 standards 2021-03-16 12:43:50 +00:00
Jean-François Milants
9f67e6f652 Merge branch 'develop' into recovery-firmware
# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/DisplayApp.h
#	src/systemtask/SystemTask.cpp
#	src/systemtask/SystemTask.h
2021-03-07 08:44:14 +01:00
Joaquim
8c53d0b70b Multi face support, analog clock, 12/24 config 2021-02-24 19:40:24 +00:00
Jean-François Milants
5fdfb2112e Fix merge conflict. 2021-02-14 14:19:30 +01:00
petter
1e2cc3ce91 add vibration toggle 2021-02-07 13:31:02 +01:00
petter
1bd5457848 trigger vibration from systemtask 2021-02-05 15:43:20 +01:00
Jean-François Milants
25f35c7d0e Generate pinetime-recovery : a light version of InfiniTime design to be used as a recovery firmware : it only provides basic UI and BLE connectivity for OTA.
This new FW is build on the same codebasse than the actual InfiniTime. Only the display task is different (this allows to remove lvgl from the recovery fw, which is very heavy).

CMake builds and docker have been modified accordingly.
Note than the fw is converted into an image and then into a DFU in the cmake build (previously, it was only done in the
2021-01-26 20:31:45 +01:00
petter
3dd88339f3 create motorcontroller in main and pass by reference 2021-01-25 12:45:04 -05:00
Jean-François Milants
219bafb01a Handle call notification the same way than other notifications.
Display the call notifications in the Notification app, with buttons to accept/reject the call.
2021-01-24 17:22:39 +01:00
Rasmus Schenstrom
10ba20876f Add incoming call functionality
Add categories to AlertNotification

Add new alert notification screens bases

Add Incoming Call

Add Modal

Add event to AlertNotification

Co-authored-by: Robin Karlsson <robin.karlsson@protonmail.com>
2021-01-21 23:15:29 +01:00
Jean-François Milants
68674cec53 Add heart rate BLE service. 2021-01-17 16:34:14 +01:00