mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2026-05-06 04:36:40 +02:00
Fix include paths, add missing new line at end of files, rename template types name with more explicit names
This commit is contained in:
parent
2e1227fab2
commit
d8757c50ae
@ -9,8 +9,8 @@
|
||||
#undef max
|
||||
#undef min
|
||||
|
||||
#include <drivers/SpiNorFlash.h>
|
||||
#include "infinitime.h"
|
||||
#include "drivers/SpiNorFlash.h"
|
||||
#include "port/infinitime.h"
|
||||
|
||||
namespace Pinetime {
|
||||
namespace System {
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Drivers {
|
||||
template <typename T>
|
||||
concept IsSpi = requires(T s, const uint8_t* constData, uint8_t* data, const uint8_t* constCommand, uint8_t* command, size_t size) {
|
||||
template <typename SpiImpl>
|
||||
concept IsSpi = requires(SpiImpl s, const uint8_t* constData, uint8_t* data, const uint8_t* constCommand, uint8_t* command, size_t size) {
|
||||
{ s.Write(constData, size) } -> std::same_as<bool>;
|
||||
{ s.Read(command, size, data, size) } -> std::same_as<bool>;
|
||||
};
|
||||
@ -53,4 +53,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Drivers {
|
||||
template <typename T>
|
||||
template <typename SpiImpl>
|
||||
concept IsSpiMaster =
|
||||
requires(T spi, uint8_t pin, const uint8_t* constData, uint8_t* data, const uint8_t* constCommand, uint8_t* command, size_t size) {
|
||||
requires(SpiImpl spi, uint8_t pin, const uint8_t* constData, uint8_t* data, const uint8_t* constCommand, uint8_t* command, size_t size) {
|
||||
{ spi.Init() } -> std::same_as<bool>;
|
||||
{ spi.Write(pin, constData, size) } -> std::same_as<bool>;
|
||||
{ spi.Read(pin, command, size, data, size) } -> std::same_as<bool>;
|
||||
@ -67,4 +67,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Drivers {
|
||||
template <typename T>
|
||||
concept IsFlashMemory = requires(T memory, uint32_t address, uint8_t* buffer, const uint8_t* constBuffer, size_t size) {
|
||||
template <typename MemoryImpl>
|
||||
concept IsFlashMemory = requires(MemoryImpl memory, uint32_t address, uint8_t* buffer, const uint8_t* constBuffer, size_t size) {
|
||||
{ memory.ReadIdentification() };
|
||||
{ memory.ReadStatusRegister() } -> std::same_as<uint8_t>;
|
||||
{ memory.ReadConfigurationRegister() } -> std::same_as<uint8_t>;
|
||||
@ -113,4 +113,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Spi.h"
|
||||
#include "drivers/Spi.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "port/infinitime.h"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "Spi.h"
|
||||
#include "drivers/nrf52/Spi.h"
|
||||
#include <hal/nrf_gpio.h>
|
||||
#include <nrfx_log.h>
|
||||
|
||||
|
||||
@ -27,4 +27,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,4 +64,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,4 +59,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
#include <drivers/spiFlash/SpiNorFlash.h>
|
||||
#endif
|
||||
|
||||
// #error "Do not include this"
|
||||
namespace Pinetime {
|
||||
namespace Drivers {
|
||||
#ifdef TARGET_DEVICE_PINETIME
|
||||
@ -21,4 +20,4 @@ namespace Pinetime {
|
||||
#error "No target device specified!"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user