Initial InfiniSim project

This commit is contained in:
Reinhold Gschweicher
2022-02-16 21:42:29 +01:00
parent cea006b049
commit f19355949b
78 changed files with 9978 additions and 0 deletions

15
sim/nrfx/hal/nrf_rtc.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "hal/nrf_rtc.h"
#include "task.h"
#include <chrono>
#include <stdexcept>
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;
}