Some fixes to ensure compatibility of arduino branch with stm32 features

This commit is contained in:
dario 2024-06-03 23:36:14 +02:00
parent dcc4bd2720
commit e811292ffc
3 changed files with 8 additions and 31 deletions

View File

@ -1,28 +0,0 @@
#ifndef STA_DEVICES_ARDUINO_TIME_HPP
#define STA_DEVICES_ARDUINO_TIME_HPP
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
#include <cstdint>
namespace sta
{
/**
* @brief The current time in milliseconds.
*
* @return uint32_t Returns current time in milliseconds.
*/
uint32_t now();
/**
* @brief The current time in microseconds.
*
* @return uint32_t Returns the current time in microseconds.
*/
uint32_t nowUs();
} // namespace sta
#endif // STA_PLATFORM_ARDUINO
#endif // STA_DEVICES_ARDUINO_TIME_HPP

View File

@ -5,6 +5,9 @@
#ifndef STA_CORE_STM32_INIT_HPP
#define STA_CORE_STM32_INIT_HPP
#include <config.h>
#ifdef STA_PLATFORM_STM32
#include <sta/devices/stm32/hal.hpp>
namespace sta
@ -17,5 +20,6 @@ namespace sta
void initHAL();
} // namespace sta
#endif // STA_PLATFORM_STM32
#endif // STA_CORE_STM32_INIT_HPP

View File

@ -1,16 +1,17 @@
#include <sta/devices/arduino/time.hpp>
#include <sta/time.hpp>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
#include <sta/devices/arduino/hal.hpp>
namespace sta
{
uint32_t now()
uint32_t timeMs()
{
return millis();
}
uint32_t nowUs()
uint32_t timeUs()
{
return micros();
}