From 3a3a14115a81b9dd2c6f839c0ad1b14d04367642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 17 Jan 2021 16:33:45 +0100 Subject: [PATCH] Add License/copyright info in HR related files. --- src/components/heartrate/Biquad.cpp | 7 +++++++ src/components/heartrate/Ppg.cpp | 8 +++++++- src/components/heartrate/Ptagc.cpp | 7 +++++++ src/drivers/Hrs3300.cpp | 10 +++++++++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/heartrate/Biquad.cpp b/src/components/heartrate/Biquad.cpp index 37b3ba67..6a4b8181 100644 --- a/src/components/heartrate/Biquad.cpp +++ b/src/components/heartrate/Biquad.cpp @@ -1,7 +1,14 @@ +/* + SPDX-License-Identifier: LGPL-3.0-or-later + Original work Copyright (C) 2020 Daniel Thompson + C++ port Copyright (C) 2021 Jean-François Milants +*/ + #include "Biquad.h" using namespace Pinetime::Controllers; +/** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ Biquad::Biquad(float b0, float b1, float b2, float a1, float a2) : b0{b0}, b1{b1}, b2{b2}, a1{a1}, a2{a2} { } diff --git a/src/components/heartrate/Ppg.cpp b/src/components/heartrate/Ppg.cpp index 27617c15..233c3003 100644 --- a/src/components/heartrate/Ppg.cpp +++ b/src/components/heartrate/Ppg.cpp @@ -1,10 +1,16 @@ +/* + SPDX-License-Identifier: LGPL-3.0-or-later + Original work Copyright (C) 2020 Daniel Thompson + C++ port Copyright (C) 2021 Jean-François Milants +*/ + #include #include #include "Ppg.h" using namespace Pinetime::Controllers; +/** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ namespace { - // TODO no vector! int Compare(int* d1, int* d2, size_t count) { int e = 0; for(int i = 0; i < count; i++) { diff --git a/src/components/heartrate/Ptagc.cpp b/src/components/heartrate/Ptagc.cpp index 9302af97..dd7c4411 100644 --- a/src/components/heartrate/Ptagc.cpp +++ b/src/components/heartrate/Ptagc.cpp @@ -1,8 +1,15 @@ +/* + SPDX-License-Identifier: LGPL-3.0-or-later + Original work Copyright (C) 2020 Daniel Thompson + C++ port Copyright (C) 2021 Jean-François Milants +*/ + #include #include "Ptagc.h" using namespace Pinetime::Controllers; +/** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ Ptagc::Ptagc(float start, float decay, float threshold) : peak{start}, decay{decay}, boost{1.0f/decay}, threshold{threshold} { } diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index 31956575..2aded7d3 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -1,3 +1,9 @@ +/* + SPDX-License-Identifier: LGPL-3.0-or-later + Original work Copyright (C) 2020 Daniel Thompson + C++ port Copyright (C) 2021 Jean-François Milants +*/ + #include #include #include "Hrs3300.h" @@ -7,7 +13,9 @@ #include using namespace Pinetime::Drivers; - +/** Driver for the HRS3300 heart rate sensor. + * Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/drivers/hrs3300.py + */ Hrs3300::Hrs3300(TwiMaster &twiMaster, uint8_t twiAddress) : twiMaster{twiMaster}, twiAddress{twiAddress} { }