Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/ble/HeartRateService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ void HeartRateService::Init() {
int HeartRateService::OnHeartRateRequested(uint16_t connectionHandle, uint16_t attributeHandle,
ble_gatt_access_ctxt *context) {
if(attributeHandle == heartRateMeasurementHandle) {
NRF_LOG_INFO("BATTERY : handle = %d", heartRateMeasurementHandle);
static uint8_t batteryValue = heartRateController.HeartRate();

NRF_LOG_INFO("HEARTRATE : handle = %d", heartRateMeasurementHandle);
uint8_t buffer[2] = {0, heartRateController.HeartRate()}; // [0] = flags, [1] = hr value

int res = os_mbuf_append(context->om, buffer, 2);
Expand Down
4 changes: 2 additions & 2 deletions src/components/ble/NimbleController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
navService{systemTask},
batteryInformationService{batteryController},
immediateAlertService{systemTask, notificationManager},
serviceDiscovery({&currentTimeClient, &alertNotificationClient}),
heartRateService{systemTask, heartRateController} {
heartRateService{systemTask, heartRateController},
serviceDiscovery({&currentTimeClient, &alertNotificationClient}) {
}

int GAPEventCallback(struct ble_gap_event *event, void *arg) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/heartrate/Ppg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace Pinetime::Controllers;
namespace {
int Compare(int* d1, int* d2, size_t count) {
int e = 0;
for(int i = 0; i < count; i++) {
for(size_t i = 0; i < count; i++) {
auto d = d1[i] - d2[i];
e += d * d;
}
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/Hrs3300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ void Hrs3300::SetGain(uint8_t gain) {
static constexpr uint8_t maxGain = 64;
gain = std::min(gain, maxGain);
uint8_t hgain = 0;
while((1 << hgain) < gain)
while((1 << hgain) < gain) {
hgain++;

WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2);
}
}

void Hrs3300::SetDrive(uint8_t drive) {
Expand Down