Commit Graph

68 Commits

Author SHA1 Message Date
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
34949a47c5
Dim screen before sleep (#464)
* Implement dimming
2021-07-24 20:29:10 +02: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
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
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
Jean-François Milants
04063cf0af HR Sensor : Add start/stop button to the HeartRate app (the HR sensors stays ON when the app is closed), display the HR value on the Clock app. 2021-01-17 10:39:46 +01:00
Jean-François Milants
c82c22650c HR Sensor : do not go to sleep when the HR app is running. 2021-01-10 22:02:21 +01:00