First sta-Core rework to work for Arduino

This commit is contained in:
dario 2024-02-09 14:33:05 +01:00
parent 7f451cd868
commit 4490c68ee3
19 changed files with 96 additions and 35 deletions

View File

@ -7,7 +7,12 @@
#include <sta/bus/can/id.hpp>
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
#else
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -7,7 +7,12 @@
#include <sta/bus/can/id.hpp>
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
#else
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -5,7 +5,12 @@
#ifndef STA_CORE_CAN_ID_HPP
#define STA_CORE_CAN_ID_HPP
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
#else
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -5,7 +5,12 @@
#ifndef STA_CORE_CAN_ITER_HPP
#define STA_CORE_CAN_ITER_HPP
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
#else
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -4,9 +4,6 @@
#include <sta/bus/interface.hpp>
#include <sta/mutex.hpp>
#include <cstddef>
#include <cstdint>
namespace sta
{
/**

View File

@ -3,8 +3,14 @@
#include <sta/mutex.hpp>
#include <cstdint>
#include <cstddef>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
# include <stddef.h>
#else
# include <cstdint>
# include <cstddef>
#endif // STA_PLATFORM_ARDUINO
namespace sta
{

View File

@ -9,9 +9,6 @@
#include <sta/bus/spi/spi.hpp>
#include <sta/gpio_pin.hpp>
#include <cstddef>
#include <cstdint>
namespace sta
{

View File

@ -11,7 +11,12 @@
* @brief SPI interface.
*/
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
#else
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta
{

View File

@ -9,10 +9,6 @@
#include <sta/bus/spi/settings.hpp>
#include <sta/mutex.hpp>
#include <cstddef>
#include <cstdint>
namespace sta
{
/**

View File

@ -1,3 +1,4 @@
#include <sta/devices/arduino/mcu/common.hpp>
#define STA_PRINTF_USE_STDLIB
#define STA_PRINTF_USE_STDLIB
#define STA_STDLIB_DISABLE

View File

@ -5,9 +5,14 @@
#ifndef STA_CORE_PRINTABLE_HPP
#define STA_CORE_PRINTABLE_HPP
#include <cstddef>
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdint.h>
# include <stddef.h>
#else
# include <cstddef>
# include <cstdint>
#endif
namespace sta
{

View File

@ -8,8 +8,14 @@
#include <sta/bus/uart/uart.hpp>
#include <sta/debug/printing/printable.hpp>
#include <cstddef>
#include <cstdint>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stddef.h>
# include <stdint.h>
#else
# include <cstddef>
# include <cstdint>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -11,7 +11,8 @@
#if defined(STA_PLATFORM_ARDUINO) || defined(DOXYGEN)
#include <sta/gpio_pin.hpp>
#include <cstdint>
#include <stdint.h>
namespace sta
{

View File

@ -17,7 +17,11 @@
#ifdef STA_PRINTF_USE_STDLIB
# include <cstdio>
# ifdef STA_PLATFORM_ARDUINO
# include <stdio.h>
# else
# include <cstdio>
# endif // STA_PLATFORM_ARDUINO
#endif // STA_PRINTF_USE_STDLIB
#ifdef STA_PRINTF_USE_MPALAND
# include <printf.h>

View File

@ -1,6 +1,12 @@
#include <sta/bus/spi/spi.hpp>
#include <cstdio>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdio.h>
#else
# include <cstdio>
#endif // STA_PLATFORM_ARDUINO
namespace sta
{

View File

@ -1,10 +1,16 @@
#include <sta/debug/printing/printable.hpp>
#include <cinttypes>
#include <cstring>
#include <cstdio>
#include <cstdint>
#include <stdarg.h>
#ifdef STA_PLATFORM_ARDUINO
# include <inttypes.h>
# include <string.h>
# include <stdio.h>
# include <stdarg.h>
#else
# include <cinttypes>
# include <cstring>
# include <cstdio>
# include <stdarg.h>
#endif // STA_PLATFORM_ARDUINO
#include <sta/debug/assert.hpp>
#include <sta/lang.hpp>

View File

@ -1,7 +1,12 @@
#include <sta/debug/printing/printable_printf.hpp>
#include <sta/debug/assert.hpp>
#include <cstdio>
#include <sta/config.hpp>
#ifdef STA_PLATFORM_ARDUINO
# include <stdio.h>
#else
# include <cstdio>
#endif // STA_PLATFORM_ARDUINO
namespace sta
{

View File

@ -3,8 +3,13 @@
#include <sta/debug/assert.hpp>
#include <sta/printf.hpp>
#include <cinttypes>
#include <cstring>
#ifdef STA_PLATFORM_ARDUINO
# include <inttypes.h>
# include <string.h>
#else
# include <cinttypes>
# include <cstring>
#endif // STA_PLATFORM_ARDUINO
namespace sta

View File

@ -1,10 +1,11 @@
#include <sta/devices/stm32/bus/i2c.hpp>
#include <sta/debug/assert.hpp>
#include <cstring>
#ifdef STA_STM32_I2C_ENABLED
#include <cstring>
namespace sta
{
STM32I2C::STM32I2C(I2C_HandleTypeDef * handle, Mutex * mutex)