-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yann/feature/imu/add event detection interrupt #1405
Yann/feature/imu/add event detection interrupt #1405
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## yann/refactor/imu/standardize-naming #1405 +/- ##
========================================================================
- Coverage 98.76% 98.74% -0.02%
========================================================================
Files 146 146
Lines 3793 3822 +29
========================================================================
+ Hits 3746 3774 +28
- Misses 47 48 +1 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
a4b2b94
to
9b76514
Compare
4f22469
to
1efdbb9
Compare
70719bc
to
3522d75
Compare
e4473c7
to
d2a5eaf
Compare
Quality Gate passedIssues Measures |
7959b2d
to
0f38bca
Compare
d2a5eaf
to
a3ae74e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0f38bca
to
d47f4db
Compare
a3ae74e
to
d2f09ee
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d47f4db
to
9d2d183
Compare
be9b76e
to
eb0192b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eb0192b
to
4405242
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
juste deux petites questions/requests
void CoreIMU::registerOnWakeUpCallback(std::function<void()> const &callback) | ||
{ | ||
_on_wake_up_callback = callback; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
à mon sens le register il doit enable directement.
quel est le cas d'usage où on a besoin de faire les deux séparément ?
si on a un enable, je m'attends à avoir un disable aussi
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5d683c6
to
1669492
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je pense que je préférai le set callback séparé du enable/disable
j'ai peur que l'approche là rende l'ajout d'autres interrupts compliqués et j'ai du mal à voir comment on fait cohabiter les différents interrupts.
drivers/CoreIMU/source/CoreIMU.cpp
Outdated
@@ -137,6 +137,52 @@ void CoreIMU::disableDeepSleep() | |||
setPowerMode(interface::IMU::PowerMode::Normal); | |||
} | |||
|
|||
void CoreIMU::enableOnWakeUpInterrupt(std::function<void()> const &callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je suis pas trop fan du "enable interrupt + set a callback"
pour le DataReadyInterrupt
, on enable ou disable tout simplement
ça serait mieux de faire ça là aussi et d'avoir un setWakeUpInterrupt
si on se projette un tout petit peu, on peut avoir le tap/double tap/freefall interrupts qui arrivent assez rapidement et il faut pouvoir les set et les enable/disable indépendamment et les avoir qui fonctionne en même temps.
il faut surement inverser un peu le fonctionnement et avoir le CoreIMU qui dit "y a eu un interrupt, voici son type" en utilisant un enum Interrupt
avec dedans dataReady
, wakeUp
, etc.
on peut ensuite set les callbacks indépendamment pour chaque interrupt.
en interne on a un gros switch sur le interrupt type
1669492
to
4276867
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4276867
to
89da6a4
Compare
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff output
|
🔖 Version comparison
|
Quality Gate passedIssues Measures |
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff output
|
Requis
Ressources
Registres concernés
Mise à jour du 19/07/2024
Le module LSM6DSOX embarque plusieurs reconnaissances de mouvement de base dont Wake-up et Activity, dont on peut les personnaliser que jusqu’à un certain point. Le schéma ci-dessous présente succintement quels sont les différents paramètres et les différentes reconnaissances disponibles.
On va utiliser la reconnaissance de mouvement de Activity, qui s’appuie sur la reconnaissance du mouvement Wake-up mais en plus travaillé. Les paramètres sont les suivants:
Filter and disable user offset
lsm6dsox_xl_hp_path_internal_set
| SLOPE_FDS: HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions. (Datasheet - 9.52)lsm6dsox_xl_usr_offset_on_wkup_set
| USR_OFF_ON_WU: Drives the low-pass filtered data with user offset correction (instead of high-pass filtered data) to the wakeup function. (Datasheet - 9.57)Wakeup config
From AN5272 - 5.3
lsm6dsox_wkup_threshold_set
| WK_THS: Threshold for wakeup. (Datasheet - 9.57)lsm6dsox_wkup_ths_weight_set
| WAKE_THS_W: Weight of 1 LSB of wakeup threshold. (Datasheet - 9.58)lsm6dsox_wkup_dur_set
| WAKE_DUR: Wake up duration event. (Datasheet - 9.58)Activity/Inactivity config
From AN5272 - 5.6
lsm6dsox_act_sleep_dur_set
| SLEEP_DUR: Duration to go in sleep mode. (Datasheet - 9.58)lsm6dsox_act_mode_set
| INACT_EN: Enable activity/inactivity (sleep) function. (Datasheet - 9.54)