1
0
Fork 0
InfiniSim/sim/nrfx/hal/nrf_rtc.cpp
2022-02-26 21:37:21 +01:00

16 lines
394 B
C++

#include "hal/nrf_rtc.h"
#include "task.h"
#include <chrono>
#include <stdexcept>
#include <string> // std::to_string
uint32_t nrf_rtc_counter_get(NRF_RTC_Type p_reg)
{
if (p_reg == portNRF_RTC_REG) {
TickType_t ticks_now = xTaskGetTickCount();
return ticks_now;
}
throw std::runtime_error("nrf_rtc_counter_get: unhandled NRF_RTC_Type: " + std::to_string(p_reg));
return 0;
}