aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ble
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2023-02-24 07:38:16 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-02-25 17:22:25 +0200
commitb63bb798acd9bc40adda78774e1c433ef21995a5 (patch)
tree6eb225eb665668b3d7c4b048fe38c91b8e6f72d6 /src/components/ble
parenteccea5ab9f43eea3c3ac6dbfb7e03dd81578191c (diff)
DateTimeController: Remove SetTime tick parameter
The systick doesn't need to be updated when setting time. Also removed unused nrf_rtc.h includes.
Diffstat (limited to 'src/components/ble')
-rw-r--r--src/components/ble/CurrentTimeClient.cpp4
-rw-r--r--src/components/ble/CurrentTimeService.cpp4
-rw-r--r--src/components/ble/NimbleController.cpp1
3 files changed, 2 insertions, 7 deletions
diff --git a/src/components/ble/CurrentTimeClient.cpp b/src/components/ble/CurrentTimeClient.cpp
index e535ae83..7df07106 100644
--- a/src/components/ble/CurrentTimeClient.cpp
+++ b/src/components/ble/CurrentTimeClient.cpp
@@ -1,5 +1,4 @@
#include "components/ble/CurrentTimeClient.h"
-#include <hal/nrf_rtc.h>
#include <nrf_log.h>
#include "components/datetime/DateTimeController.h"
@@ -88,8 +87,7 @@ int CurrentTimeClient::OnCurrentTimeReadResult(uint16_t conn_handle, const ble_g
uint16_t year = ((uint16_t) result.year_MSO << 8) + result.year_LSO;
NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
- dateTimeController
- .SetTime(year, result.month, result.dayofmonth, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG));
+ dateTimeController.SetTime(year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
} else {
NRF_LOG_INFO("Error retrieving current time: %d", error->status);
}
diff --git a/src/components/ble/CurrentTimeService.cpp b/src/components/ble/CurrentTimeService.cpp
index 856bc63a..012951cb 100644
--- a/src/components/ble/CurrentTimeService.cpp
+++ b/src/components/ble/CurrentTimeService.cpp
@@ -1,5 +1,4 @@
#include "components/ble/CurrentTimeService.h"
-#include <hal/nrf_rtc.h>
#include <nrf_log.h>
using namespace Pinetime::Controllers;
@@ -50,8 +49,7 @@ int CurrentTimeService::OnCurrentTimeAccessed(struct ble_gatt_access_ctxt* ctxt)
NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
- m_dateTimeController
- .SetTime(year, result.month, result.dayofmonth, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG));
+ m_dateTimeController.SetTime(year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
CtsCurrentTimeData currentDateTime;
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp
index 912f5927..74c8f926 100644
--- a/src/components/ble/NimbleController.cpp
+++ b/src/components/ble/NimbleController.cpp
@@ -1,7 +1,6 @@
#include "components/ble/NimbleController.h"
#include <cstring>
-#include <hal/nrf_rtc.h>
#include <nrf_log.h>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max