mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-23 14:57:29 +00:00
C++14: const all the methods!
This commit is contained in:
@@ -46,15 +46,15 @@ struct I2CClockConfig {
|
||||
return 1e9 / f;
|
||||
}
|
||||
|
||||
constexpr uint32_t i2c_period_count() {
|
||||
constexpr uint32_t i2c_period_count() const {
|
||||
return period_ns(bus_f) / period_ns(clock_source_f) + 0.5f;
|
||||
}
|
||||
|
||||
constexpr uint32_t i2c_high_count() {
|
||||
constexpr uint32_t i2c_high_count() const {
|
||||
return high_period_ns / period_ns(clock_source_f) + 0.5f;
|
||||
}
|
||||
|
||||
constexpr uint32_t i2c_low_count() {
|
||||
constexpr uint32_t i2c_low_count() const {
|
||||
return i2c_period_count() - i2c_high_count();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user