Skip to content
Snippets Groups Projects
Commit fd25ca9f authored by Davide Mor's avatar Davide Mor
Browse files

[TimestampTimer] Removed .cpp

parent 59ecafe8
Branches
No related tags found
No related merge requests found
...@@ -29,9 +29,6 @@ set(BOARDCORE_HOST_SRC ...@@ -29,9 +29,6 @@ set(BOARDCORE_HOST_SRC
# Actuators # Actuators
${SBS_BASE}/src/shared/actuators/Servo/Servo.cpp ${SBS_BASE}/src/shared/actuators/Servo/Servo.cpp
# Drivers
${SBS_BASE}/src/shared/drivers/timer/TimestampTimer.cpp
# Events # Events
${SBS_BASE}/src/shared/events/EventBroker.cpp ${SBS_BASE}/src/shared/events/EventBroker.cpp
......
...@@ -58,7 +58,6 @@ set(BOARDCORE_SRC ...@@ -58,7 +58,6 @@ set(BOARDCORE_SRC
${BOARDCORE_PATH}/src/shared/drivers/interrupt/external_interrupts.cpp ${BOARDCORE_PATH}/src/shared/drivers/interrupt/external_interrupts.cpp
${BOARDCORE_PATH}/src/shared/drivers/timer/PWM.cpp ${BOARDCORE_PATH}/src/shared/drivers/timer/PWM.cpp
${BOARDCORE_PATH}/src/shared/drivers/timer/CountedPWM.cpp ${BOARDCORE_PATH}/src/shared/drivers/timer/CountedPWM.cpp
${BOARDCORE_PATH}/src/shared/drivers/timer/TimestampTimer.cpp
${BOARDCORE_PATH}/src/shared/drivers/runcam/Runcam.cpp ${BOARDCORE_PATH}/src/shared/drivers/runcam/Runcam.cpp
${BOARDCORE_PATH}/src/shared/drivers/spi/SPITransaction.cpp ${BOARDCORE_PATH}/src/shared/drivers/spi/SPITransaction.cpp
${BOARDCORE_PATH}/src/shared/drivers/usart/USART.cpp ${BOARDCORE_PATH}/src/shared/drivers/usart/USART.cpp
......
/* Copyright (c) 2020-2021 Skyward Experimental Rocketry
* Authors: Luca Conterio, Davide Mor, Alberto Nidasio, Niccolò Betto
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "TimestampTimer.h"
#include <miosix.h>
#include <utils/TimeUtils.h>
namespace Boardcore
{
namespace TimestampTimer
{
uint64_t getTimestamp()
{
return static_cast<uint64_t>(nsToUs(miosix::getTime()));
}
} // namespace TimestampTimer
} // namespace Boardcore
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#pragma once #pragma once
#include <miosix.h>
#include <utils/TimeUtils.h>
#include <cstdint> #include <cstdint>
namespace Boardcore namespace Boardcore
...@@ -44,12 +47,17 @@ namespace Boardcore ...@@ -44,12 +47,17 @@ namespace Boardcore
*/ */
namespace TimestampTimer namespace TimestampTimer
{ {
/** /**
* @brief Returns the current timer value in microseconds. * @brief Returns the current timer value in microseconds.
* @deprecated Use miosix::getTime() instead and update the code to nanoseconds. * @deprecated Use miosix::getTime() instead and update the code to nanoseconds.
* *
* @return Current timestamp in microseconds. * @return Current timestamp in microseconds.
*/ */
uint64_t getTimestamp(); inline uint64_t getTimestamp()
{
return static_cast<uint64_t>(nsToUs(miosix::getTime()));
}
}; // namespace TimestampTimer }; // namespace TimestampTimer
} // namespace Boardcore } // namespace Boardcore
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment