Commit graph

53 commits

Author SHA1 Message Date
Finlay Davidson 2ba8b17967 linearapproximation: Move to src/utility 2023-03-27 22:12:32 +00:00
Riku Isokoski fff0a00a4a Revert "added low battery message"
This reverts PR https://github.com/InfiniTimeOrg/InfiniTime/pull/1352
2023-03-02 13:38:31 +02:00
Finlay Davidson 8b0d888952 batt: Improve discharge curve values
Values calculated using multiple tests on 3 PineTimes
2023-01-23 21:48:29 +01:00
Finlay Davidson 96165a8541 Format header files
In my PR updating clang-format, I forgot to also format the headers.
2023-01-09 21:41:21 +01:00
minacode a82a34cd11 format 2022-12-27 12:13:52 +01:00
minacode 557a328409 changed to bool 2022-12-27 12:13:52 +01:00
minacode 51d818b774 fixed a comment, set threshold to 15% 2022-12-27 12:13:52 +01:00
minacode 60027f217c cutout scaling hack 2022-12-27 12:13:52 +01:00
minacode 08fa6bd4e4 format 2022-12-27 12:13:52 +01:00
minacode cad58f190f added message, changed UI 2022-12-27 12:13:52 +01:00
minacode 59ee0ad1aa add percentage rescaling 2022-12-27 12:13:52 +01:00
minacode ccc8cee07a added low battery message 2022-12-27 12:13:52 +01:00
Riku Isokoski afea7ca0d1
Update clang-tidy configuration and fix some warnings (#1474)
Don't enable coding conventions from unrelated projects. Only enable
generic checks.
2022-12-18 18:14:36 +01:00
Alex Dolzhenkov 7376c02bbf Add linear approximation and use it for improving battery percentage
Add linear approximation class and use it to better model the non-linear
discharge curve of the battery.

Changed the minimum voltage level to 3.5V and the maximum to 4.18V. For
reference the maximum observed voltage is 4.21V during charging.
2022-11-19 16:34:03 +01:00
hassless a67f401b30 Update BatteryController.h with non-linear discharge curve 2022-11-19 16:34:03 +01:00
Avamander b6e9e4171d Switched to non-deprecated math header 2021-12-04 22:03:40 +02:00
Reinhold Gschweicher ac7b2da611 Update includes to to be relative to src directory
Don't use relative imports like `../foo.h` as those depend on the
relative position of both files. Rather than that use imports relative
to the `src` directory, which explicitly is part of the include
directories.
2021-11-15 22:02:49 +01:00
Riku Isokoski 1777b9dee8 Don't measure and notify percentage on charging event. 2021-10-09 13:39:27 +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
Riku Isokoski 980ac17388 Show plug icon while plugged in 2021-09-22 13:58:45 +03:00
Riku Isokoski b210090837 Merge branch 'develop' into detect_full_charge 2021-09-22 12:03:41 +03:00
hubmartin 73d3e41cea Merge branch 'develop' into pinmap 2021-09-13 10:19:07 +02:00
Riku Isokoski b31b2425f8 Use percentage instead of IsFull 2021-09-03 16:57:00 +03:00
Riku Isokoski fd52ca8fe6 Detect full charge and improve watchface display 2021-09-03 14:35:38 +03:00
Riku Isokoski 23bde0d18e Make battery reading periodic. Add events. Disable pullup 2021-08-14 21:18:11 +03:00
hubmartin 0d083a2bea Merge branch 'develop' into pinmap 2021-08-11 22:00:55 +02:00
hubmartin b3e6da7514 Cleanup, set Pinetime as default 2021-08-03 20:40:27 +02: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 09aaa58710 Remove floating point calculation 2021-08-01 16:19:09 +03:00
Riku Isokoski 79ee65bfd5 Increase ADC precision 2021-07-27 22:41:48 +03:00
Riku Isokoski b5eabf6604 Merge branch 'develop' into fix_adc 2021-07-13 22:11:46 +03:00
Riku Isokoski 7efe2b7c51 Fix misconfigured ADC and remove now unnecessary filtering 2021-07-12 23:07:05 +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
Avamander ab59b9b830
Whitespace and brace fixes (#456)
* Brace style and whitespace fixes

* Additional whitespace fixes
2021-07-04 20:06:50 +02:00
Riku Isokoski 38f40034b0
Float voltage to int (#444)
* Change voltage float to millivolt integer
* Explain the ADC to milliVolts conversion
2021-07-02 17:30:32 +02:00
Avamander bdb5965f1a static_cast cleanup 2021-07-02 16:27:41 +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
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
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
Joaquim 3cf4df905a restore battery buffer 2021-04-08 16:15:57 +01:00
Joaquim 365e68e6cc Fix wake up lock in twi
optimize battery code
2021-04-05 15:22:10 +01:00
Joaquim bb7531e208 double tap wakeup error fix
battery nonblocking read
2021-04-04 13:51:22 +01:00
panky-codes b31c0e7e45 Added more descriptive comments in doxygen format. 2021-01-17 11:06:24 +01:00
panky-codes 952021cdb6 Changed float to int in battery controller file. 2021-01-16 21:31:58 +01:00
panky-codes 8697a06642 Changed std accumulate to use int instead of a float. 2021-01-16 20:46:01 +01:00
panky-codes 271ca78be5 Converted all the other float usage to int. 2021-01-16 20:18:55 +01:00
panky-codes e2d1f81915 Converted percent remaining calc to int. 2021-01-16 19:51:32 +01:00
panky-codes dece6c6bc8 Adapted the accumulate function to return float. 2021-01-14 22:11:17 +01:00