Skip to content

Commit 97a1c4b

Browse files
authored
Merge pull request #182 from petterhs/warnings
Fix build warnings coming from HR implementation
2 parents 07a0d7c + 169b861 commit 97a1c4b

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/components/ble/HeartRateService.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ void HeartRateService::Init() {
5757
int HeartRateService::OnHeartRateRequested(uint16_t connectionHandle, uint16_t attributeHandle,
5858
ble_gatt_access_ctxt *context) {
5959
if(attributeHandle == heartRateMeasurementHandle) {
60-
NRF_LOG_INFO("BATTERY : handle = %d", heartRateMeasurementHandle);
61-
static uint8_t batteryValue = heartRateController.HeartRate();
62-
60+
NRF_LOG_INFO("HEARTRATE : handle = %d", heartRateMeasurementHandle);
6361
uint8_t buffer[2] = {0, heartRateController.HeartRate()}; // [0] = flags, [1] = hr value
6462

6563
int res = os_mbuf_append(context->om, buffer, 2);

src/components/ble/NimbleController.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
3838
navService{systemTask},
3939
batteryInformationService{batteryController},
4040
immediateAlertService{systemTask, notificationManager},
41-
serviceDiscovery({&currentTimeClient, &alertNotificationClient}),
42-
heartRateService{systemTask, heartRateController} {
41+
heartRateService{systemTask, heartRateController},
42+
serviceDiscovery({&currentTimeClient, &alertNotificationClient}) {
4343
}
4444

4545
int GAPEventCallback(struct ble_gap_event *event, void *arg) {

src/components/heartrate/Ppg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace Pinetime::Controllers;
1313
namespace {
1414
int Compare(int* d1, int* d2, size_t count) {
1515
int e = 0;
16-
for(int i = 0; i < count; i++) {
16+
for(size_t i = 0; i < count; i++) {
1717
auto d = d1[i] - d2[i];
1818
e += d * d;
1919
}

src/drivers/Hrs3300.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ void Hrs3300::SetGain(uint8_t gain) {
7373
static constexpr uint8_t maxGain = 64;
7474
gain = std::min(gain, maxGain);
7575
uint8_t hgain = 0;
76-
while((1 << hgain) < gain)
76+
while((1 << hgain) < gain) {
7777
hgain++;
78-
7978
WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2);
79+
}
8080
}
8181

8282
void Hrs3300::SetDrive(uint8_t drive) {

0 commit comments

Comments
 (0)