Commit Graph

194 Commits

Author SHA1 Message Date
Wojtek Rzepecki
0c098808e8 [EGD-5660] Add PWM Cpu sentinel
Change of PWM frequency due
to main clock change in low
power operation.
2021-02-25 17:09:05 +01:00
Tomasz Sobkowiak
0022da5e37 [EGD-5204] Show passcode screen only when PC is connected
USBConfigured event is not fired when powerbank, charger is connected.

[EGD-5204] Show passcode screen only when PC is connected

USBConfigured event is not fired when powerbank, charger is connected.
2021-02-25 10:28:08 +01:00
Piotr Tański
d5c3d41ca4 [EGD-5204] Secure USB communication
Secure all endpoints by returning 403(Forbidden) when USB is connected.
Request screen passcode to enable secured endpoints.
2021-02-24 19:49:07 +01:00
Borys Jelenski
d9ae779a37 [EGD-5503] Add watchdog implementation
The system watchdog monitors whether there is message traffic
on the Bus. If no message was sent for an extended period of time,
a reset will occur. It should also protect against system-wide hangs.

On Linux, watchdog is simulated by a FreeRTOS task that will call exit
on timeout.
2021-02-19 11:32:12 +01:00
Lukasz Skrzypczak
cefe442d77 [EGD-3685] PR fixes
Included Alek's suggestions from PR
2021-02-18 17:27:54 +01:00
Lukasz Skrzypczak
819d0ff833 [EGD-3685] Fixed linux stubs
Fixed broken linux stubs
2021-02-18 17:27:54 +01:00
Lukasz Skrzypczak
a5d1fadf2e [EGD-3685] Vibra handling
Added driver & business logic. Responds to messages.
2021-02-18 17:27:54 +01:00
Adam Dobrowolski
f724d9074b [EGD-5701] Added DOM dump to harness
* Added generic handler to developerMode
* Added DOM message handling
2021-02-18 16:53:07 +01:00
Wojtek Rzepecki
465159ed15 [EGD-5805] Fix not charging icon
Fix icons behavior in topbar.
When plugged and no charging
regular dischrging icon is
displayed.
2021-02-18 12:06:50 +01:00
Maciej-Mudita
11aa4c7ffb [EGD-5382] Add LowPower CpuSentinels
In order to synchronize the Low Power mode, the services were
immediately informed about the frequency change,
so that they can update their resources (e.g. PWM filling)
and services may request the maximum CPU frequency in order
to perform a task (e.g. screen redraw, telephone conversation)
2021-02-12 09:40:36 +01:00
Wojtek Rzepecki
a6cdd53a86 [EGD-5577] Add charger temperature cutoff
Battery charger cutoff due in
selected temperature range. Proper
charged state detection for rt1051
2021-02-12 08:18:03 +01:00
SP2FET
a6d2481c9e [EGD-5694] Add BT DMA deinit
Implemented BT DMA deinit for Bluetooth off functionality

Co-authored-by: grzyw-o-mat
2021-02-11 12:01:58 +01:00
Maciej-Mudita
ec56afc933 [EGD-5381] Add Low Power Drivers
Peripherals clock synchronization dependent on PLL2
2021-02-10 08:46:13 +01:00
Marek Niepieklo
ab28f1021e [EGD-5664] Fix excessive logging in USB-CDC
Remove excessive logging in USB-CDC, which slows down transfer
2021-02-08 17:44:30 +01:00
Wojtek Rzepecki
8204cba1ab [EGD-5575] Add battery file test
Battery file existence test for
harness test suit. Minor changes to
file saving applied.
2021-02-08 15:57:17 +01:00
Marek Niepieklo
7eebea8698 [EGD-5377] Add USB charger detection
Added USB stack support for detecting connected charger
Added i.MX RT 1051 HW configuration
Added notification to EventManager for detected charger
2021-02-04 12:51:56 +01:00
Radoslaw Wicik
d14e40d378 [EGD-4831] Add license headers to c, h and sql files
Add license headers to `h`, `c` and `sql` files as this files haven't
been checked previously, script now to automatically updates current
year in existing licenses.
2021-01-28 14:41:33 +01:00
Mateusz Grzywacz
65023ca120 [EGD-5256] Eink display - speed up in some scenarios
Causes slight speed-up in specific scenarios
(changing windows, also: then rapid navigation)
also: on a regular basis (shaky temperature measumt.)
2021-01-22 20:03:26 +01:00
mkamonMdt
2dc0bc3676 [EGD-4850] Fix of statics between USB CDC and ServiceDesktop
Handling queues with static std::string implementation caused
problem of double-free memory on turning off simulator. Applied
solution to the problem is to pass ownership of queued string to
a receiver side.
2021-01-22 09:21:59 +01:00
Wojtek Rzepecki
84f2dc4f02 [EGD-5346] Refactor of battery charger BSP
Pure refactoring of battery charger to privide compliance
 with modern C++ standards. Done before implementation of
battery charging algorithms.
2021-01-21 15:37:39 +01:00
Marcin Smoczyński
40bf381eca [EGD-5086] Fix voice not starting when calling
Due to a race condition between source and sink voice is not always
starting when calling. Introduce audio stream connections to avoid
race condition and improve handling of audio start and stop operations.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-01-14 11:03:47 +01:00
Maciej-Mudita
1521858134 [EGD-4887] Add PLL2 clock switching
Pll2 will be disabled at the lowest CPU frequency,
which will save power
2021-01-12 10:02:58 +01:00
Maciej-Mudita
0c0fdef19b [EGD-4881] Add oscillator clock switching mechanisms
Osc will change automatically at the lowest CPU frequency,
which will save power
2021-01-08 10:00:11 +01:00
Wojtek Rzepecki
7e157e83a2 [EGD-5050] Add brownout detection
Brownout detectection realized through charger driver
2021-01-07 10:55:25 +01:00
Mateusz Grzywacz
fdd68635fb [EGD-5089] linux battery bsp charging done added 2021-01-04 13:14:30 +01:00
Mateusz Grzywacz
6a1c0783bc [EGD-4999] fix charger pluging but no icon on Linux 2021-01-04 13:14:30 +01:00
Marek Niepieklo
b92c40237d [EGD-5004] Add USB-CDC echo mechanism
Added echo mechanism to USB-CDC, update usb_stack submodule
and added a test case to test harness
2020-12-22 23:05:04 +01:00
Maciej-Mudita
f9b9967b0e [EGD-4694] Add CPU frequency shift mechanism
The CPU frequency changes automatically which saves energy
2020-12-22 18:00:57 +01:00
Wojtek Rzepecki
9e909e3f8e [EGD-4952] Added stetings for battery critical level 2020-12-21 10:12:05 +01:00
Wojtek Rzepecki
24608a36fa [EGD-4952] Cleanup 2020-12-21 10:12:05 +01:00
Wojtek Rzepecki
f1160fb155 [EGD-4952] Moved battery level check to separate module 2020-12-21 10:12:05 +01:00
Wojtek Rzepecki
df37008c66 [EGD-4952] Fixes for rt1051 2020-12-21 10:12:05 +01:00
Wojtek Rzepecki
4b27ef0763 [EGD-4952] Added battery check at init and if crit level changed 2020-12-21 10:12:05 +01:00
Wojtek Rzepecki
243deec8d5 [EGD-4952] Added critical level check + messages 2020-12-21 10:12:05 +01:00
Piotr Tanski
4e0f72e70a [EGD-4696] Several stabilization patches. (#1192) 2020-12-15 15:30:13 +01:00
wojtekrzepecki
c58bb1ad70 [EGD 4654] spike light sensor to display (#1158)
* [EGD-4654] Light control first working

* [EGD-4654] Extended interface with custom brightness function

* [EGD-4654] Extended set of actions

* [EGD-4654] Fixed timer issue + cleanup

* [EGD-4654] Improving switch-case logic

* [EGD-4654] Moved keypad light control to previous state

* [EGD-4654] Refactor in screen light message

* [EGD-4654] Documentation work

* [EGD-4654] Extension of docu

* [EGD-4654] Typo fixing

* [EGD-4654] More improvements in doc

* [EGD-4654] Doxy generation fixes

* [EGD-4654] Pre pr cleanup

* [EGD-4654] PR comments pt 1

* [EGD-4654] Docu small change

* [EGD-4654] Doc updated with pumls

* [EGD-4654] added newlines at the end

Co-authored-by: Wojtek Rzepecki <wojtek.rzepecki@mudita.com>
2020-12-11 15:24:01 +01:00
Mateusz Grzywacz
8df9b22ac9 [EGD-4582] Bluetooth over DMA (#1115)
[EGD-4582] Bluetooth UART: replace polling with DMA
2020-12-08 13:39:18 +01:00
wojtekrzepecki
4aef4d8166 [EGD-4653] BSP: amblient light sensor (#1135)
* [EGD-4653] Added first working readout

* [EGD-4653] Light sensor first working irq

* [EGD-4653] Interrupt config

* [EGD-4653] Cleanup

* [EGD-4653] Linux target file added

* [EGD-4653] Added messages with readout + fix of keypad light message

* [EGD-4653] Proper lux calculation

* [EGD-4653] Branch fix

* [EGD-4653] Pre PR cleanup

* [EGD-4653] Clang tidy hints application

* [EGD-4653] PR comments pt1

* [EGD-4653] Style branch fix

* [EGD-4653] Pr comments pt2

Co-authored-by: Wojtek Rzepecki <wojtek.rzepecki@mudita.com>
2020-12-04 15:21:45 +01:00
Maciej Gibowicz
0cc2af0850 [EGD-4472] PowerManagement: Separation of CPU clock into separate clock domain (#1125)
Change CPU clock into separate clock domain

We can control the CPU frequency independently of the peripherals.
2020-12-03 12:04:53 +01:00
wojtekrzepecki
be057d28d4 [EGD 4449] display backlight (#1120)
* [EGD-4449] Added fsl drivers for pwm

* [EGD-4449] Added sketch of cpp wrapper for PWM driver

* [EGD-4449] First configuration of pwm

* [EGD-4449] Pin Mux config added

* [EGD-4449] Finalized basic configuration

* [EGD-4449] Added layer of eink frontlight control

* [EGD-4449] Added to worker event

* [EGD-4449] Added getter for brightness level

* [EGD-4449] Added mutex and clamp

* [EGD-4449] First working PWM driver configuration

* [EGD-4449] More minimalistic interface

* [EGD-4449] Cleaning and refactoring

* [EGD-4449] Connected to message system

* [EGD-4449] Added gamma correction

* [EGD-4449] PWM Start/Stop logic configuration

* [EGD-4449] Linux target file added

* [EGD-4449] Minor refactorings

* [EGD-4449] Branch style fix

* [EGD-4449] PR comments pt 1

* [EGD-4449] PR comments pt 2

* [EGD-4449] branch style fix

* [EGD-4449] PR pt3 - messages change

* [EGD-4449] Minor change

* [EGD-4449] BrightnessLevel type added

* [EGD-4449] Moved processing to EventManager

* [EGD-4449] 1-5 levels to percentage

* [EGD-4449] Fix style

Co-authored-by: Wojtek Rzepecki <wojtek.rzepecki@mudita.com>
2020-12-02 16:29:03 +01:00
Roman Kubiak
9fdb298463 [EGD-4557] implement usb-deinit (#1101)
Added usb deinit calls for rt1051 and linux
2020-11-30 10:41:11 +01:00
wojtekrzepecki
7e568d3c95 [EGD-4175] keyboard backlight (#1082)
* [EGD-4483] fix for put_64 in libmtp

* [EGD-4175] Added cpp to cmake script

* [EGD-4175] Rename to keypad_backlight and first test

* [EGD-4175] First working setup

* [EGD-4175] Remaking the interface

* [EGD-4175] Added class to event manager

* [EGD-4175] Cleaning

* [EGD-4175] Added linux target file

* [EGD-4175] Added missing deinit

* [EGD-4175] cleanup

* [EGD-4175] Added check state function

* [EGD-4175] Simpler interface

* [EGD-4175] Linux target file adjustment

* [EGD-4175] Cleanup ..

* [EGD-4175] Style check fail repair

* [EGD-4175] Another style check fix

* [EGD-4175] Applying style branch fix

* [EGD-4175] Red<->Green exchange

* [EGD-4175] PR comments pt1

* [EGD-4175] PR comments pt2

* [EGD-4175] PR comments pt3

* [EGD-4175] Another style check fix

* [EGD-4175] next PR comments

* [EGD-4175] New cpp file for evm, namespaces fix

* [EGD-4175] Last pr cleaning

* [EGD-4175] Yet another style check fix...

* [EGD-4175] Final fixes from pr

Co-authored-by: Roman Kubiak <roman.kubiak@mudita.com>
Co-authored-by: Wojtek Rzepecki <wojtek.rzepecki@mudita.com>
2020-11-30 09:25:11 +01:00
Bartosz Cichocki
ed9e55f5f6 [EGD-4420] added timeout for opening serial port (#1077)
[EGD-4420] added pts to file writing and checking on the test side

Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-11-25 12:38:08 +01:00
Roman Kubiak
b4814861b0 [EGD-4318] enable service desktop (#973)
* [EGD-3688] Relax retries count for send
enable ServiceDesktop

* [EGD-3688] Relax retries count for send
enable ServiceDesktop

* [EGD-4318] enable service desktop and USB communication
CDC for serial port (communication with Mudita Center)
MTP for file transfer

* [EGD-4318] include path fix

* [egd-4318] constexpr brought back

* [EGD-4318]: review changes
- all BSP specific code moved to bsp files
- added a device listener class for USB
- simplified WorkerDesktop

* [EGD-4318] more reivew fixes mostly include paths and enums

* [EGD-4319] review fixes for SP2FET

* [EGD-4318] updates for large messages sent from phone

* [EGD-4318] more review fixes
- error checks on linux (ptms open and ptsname)
- removed all vfs
- service-desktop won't start if worker init fails

* [EGD-4318] updated return values for usbInit

* Update module-services/service-desktop/WorkerDesktop.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* Update module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* [EGD-4318] review fixes
- removed #define
- return values for usbInit

* Update module-bsp/board/linux/usb_cdc/usb_cdc.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* [EGD-4318] updated taglib

* [EGD-4318] style fixes

* Update module-bsp/board/linux/usb_cdc/usb_cdc.cpp

Co-authored-by: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* [EGD-4318] switches from freertos Timer class to sys::Timer

* Update module-services/service-desktop/WorkerDesktop.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* Update module-services/service-desktop/WorkerDesktop.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* [EGD-4318] added mutex/lock during raw data transfers

* [EGD-4318] if the TAR file is zero size or invalid
mtar_close causes HF. This is a workaround

* [EGD-4318] timer should not start on constructor

* [EGD-4318] getRawMode is const noecept

Co-authored-by: unknown <atom@prostate.local>
Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>
Co-authored-by: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>
2020-11-19 17:44:23 +01:00
Lucjan Bryndza
97d865c070 [EGD-4330] file streams ld preload library (#982)
* [EGD-4330] file streams ld preload library

It is concept library LD_PRELOAD for handle syscalls wrapper to the
image fat file.

* [EGD-4330] Stdlib implementation

* [EGD-4330] Stdio syscalls

* [EGD-4330] Dir searching stdlib replacement

* [EGD-4330] NL at end of file

* [EGD-4261] Working version of library wrapper

* [EGD-4330] Script for run emulator on fs image

Run phone emulator using filesystem image

* [EGD-4261] Missing debug file

* [EGD-4330] Not needed to link...

* [EGD-4330] Code review fixes #1
    iosyscalls

* [EGD-4330] Code review fixes round #2

* [EGD-4330] Code review round #3

* Ident fixes

* [EGD-4330] Ident fixes

* [EGD-4330] Code review round #4

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-12 16:53:23 +01:00
Bartosz Cichocki
d2589ec5ee [EGD-4359] fixed linux USB sending (#989)
Fixed USB linux sending to be able to use test harness on the simulator


Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-11-09 18:23:47 +01:00
Bartosz Cichocki
d5baec3837 [EGD-4211] moved test harness into service-desktop (#945)
Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-11-05 13:37:34 +01:00
Roman Kubiak
eb1f8206b4 [EGD-3688] usb stack as an external module (#906)
* [EGD-3688] usb stack as an external module
removed old usb code

* [EGD-3688] linux fix

* [EGD-3688] fixes for new USB code

* [EGD-3688] updated submodule
2020-11-04 18:10:34 +01:00
Mateusz Grzywacz
70a4b21c33 [EGD-3045] Magnetometer driver (#788)
* [EGD-3045] magnetometer driver - timer polling approach
- magneto pin mux
- magneto reg structs
- magneto irq skeleton
- bluetooth irq handler moved
- dedicated i2c methods
- bitfields parsed and populated explicitly
* [misc] big endian ↔ long conversion in Utils + UT
2020-10-22 15:41:54 +02:00
Bartosz Cichocki
061479780b [EGD-4011] added BT audio device with A2DP playback (#870)
Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-10-22 09:59:13 +02:00