mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-06 13:44:26 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -30,48 +30,46 @@ namespace spi {
|
|||
namespace arbiter {
|
||||
|
||||
class Arbiter {
|
||||
public:
|
||||
constexpr Arbiter(
|
||||
SPI& bus
|
||||
) : _bus(bus),
|
||||
_config(nullptr)
|
||||
{
|
||||
}
|
||||
public:
|
||||
constexpr Arbiter(
|
||||
SPI& bus)
|
||||
: _bus(bus),
|
||||
_config(nullptr) {
|
||||
}
|
||||
|
||||
void transfer(const SPIConfig* const config, void* const data, const size_t count) {
|
||||
if( config != _config ) {
|
||||
_bus.stop();
|
||||
_bus.start(*config);
|
||||
_config = config;
|
||||
}
|
||||
_bus.transfer(data, count);
|
||||
}
|
||||
void transfer(const SPIConfig* const config, void* const data, const size_t count) {
|
||||
if (config != _config) {
|
||||
_bus.stop();
|
||||
_bus.start(*config);
|
||||
_config = config;
|
||||
}
|
||||
_bus.transfer(data, count);
|
||||
}
|
||||
|
||||
private:
|
||||
SPI& _bus;
|
||||
const SPIConfig* _config;
|
||||
private:
|
||||
SPI& _bus;
|
||||
const SPIConfig* _config;
|
||||
};
|
||||
|
||||
class Target {
|
||||
public:
|
||||
constexpr Target(
|
||||
Arbiter& arbiter,
|
||||
const SPIConfig& config
|
||||
) : _arbiter(arbiter),
|
||||
_config(config)
|
||||
{
|
||||
}
|
||||
public:
|
||||
constexpr Target(
|
||||
Arbiter& arbiter,
|
||||
const SPIConfig& config)
|
||||
: _arbiter(arbiter),
|
||||
_config(config) {
|
||||
}
|
||||
|
||||
void transfer(void* const data, const size_t count) {
|
||||
_arbiter.transfer(&_config, data, count);
|
||||
}
|
||||
void transfer(void* const data, const size_t count) {
|
||||
_arbiter.transfer(&_config, data, count);
|
||||
}
|
||||
|
||||
private:
|
||||
Arbiter& _arbiter;
|
||||
const SPIConfig _config;
|
||||
private:
|
||||
Arbiter& _arbiter;
|
||||
const SPIConfig _config;
|
||||
};
|
||||
|
||||
} /* arbiter */
|
||||
} /* spi */
|
||||
} // namespace arbiter
|
||||
} // namespace spi
|
||||
|
||||
#endif/*__SPI_ARBITER_H__*/
|
||||
#endif /*__SPI_ARBITER_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue