DateTimeController: Remove SetTime tick parameter
The systick doesn't need to be updated when setting time. Also removed unused nrf_rtc.h includes.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user