diff --git a/components/adc/include/adc_types.hpp b/components/adc/include/adc_types.hpp index 7a2255ee2..89d3936a4 100644 --- a/components/adc/include/adc_types.hpp +++ b/components/adc/include/adc_types.hpp @@ -24,21 +24,21 @@ static bool operator==(const AdcConfig &lhs, const AdcConfig &rhs) { return !(lh // for libfmt printing of adc_unit_t template <> struct fmt::formatter : fmt::formatter { - template auto format(adc_unit_t t, FormatContext &ctx) { + template auto format(adc_unit_t t, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "ADC_UNIT_{}", (int)t + 1); } }; // for libfmt printing of adc_channel_t template <> struct fmt::formatter : fmt::formatter { - template auto format(adc_channel_t t, FormatContext &ctx) { + template auto format(adc_channel_t t, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "ADC_CHANNEL_{}", (int)t); } }; // for libfmt printing of adc_atten_t template <> struct fmt::formatter : fmt::formatter { - template auto format(adc_atten_t t, FormatContext &ctx) { + template auto format(adc_atten_t t, FormatContext &ctx) const { switch (t) { case ADC_ATTEN_DB_0: return fmt::format_to(ctx.out(), "ADC_ATTEN_DB_0"); @@ -55,9 +55,12 @@ template <> struct fmt::formatter : fmt::formatter { // for easy serialization of AdcConfig with libfmt template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(const espp::AdcConfig &c, FormatContext &ctx) { + template + auto format(const espp::AdcConfig &c, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "AdcConfig(unit={}, channel={}, attenuation={})", c.unit, c.channel, c.attenuation); } diff --git a/components/ads7138/include/ads7138.hpp b/components/ads7138/include/ads7138.hpp index a2cc9bd9d..e0e3bff96 100644 --- a/components/ads7138/include/ads7138.hpp +++ b/components/ads7138/include/ads7138.hpp @@ -1497,10 +1497,12 @@ class Ads7138 : public BasePeripheral<> { // for allowing easy serialization/printing of the // espp::Ads7138::OverSamplingRatio enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Ads7138::OversamplingRatio const &ratio, FormatContext &ctx) { + auto format(espp::Ads7138::OversamplingRatio const &ratio, FormatContext &ctx) const { switch (ratio) { case espp::Ads7138::OversamplingRatio::NONE: return fmt::format_to(ctx.out(), "NONE"); @@ -1527,10 +1529,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Ads7138::Mode enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Ads7138::Mode const &mode, FormatContext &ctx) { + auto format(espp::Ads7138::Mode const &mode, FormatContext &ctx) const { switch (mode) { case espp::Ads7138::Mode::MANUAL: return fmt::format_to(ctx.out(), "MANUAL"); @@ -1547,10 +1551,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Ads7138::DataFormat enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Ads7138::DataFormat const &format, FormatContext &ctx) { + auto format(espp::Ads7138::DataFormat const &format, FormatContext &ctx) const { switch (format) { case espp::Ads7138::DataFormat::RAW: return fmt::format_to(ctx.out(), "RAW"); @@ -1565,10 +1571,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Ads7138::Append enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Ads7138::Append const &format, FormatContext &ctx) { + auto format(espp::Ads7138::Append const &format, FormatContext &ctx) const { switch (format) { case espp::Ads7138::Append::NONE: return fmt::format_to(ctx.out(), "NONE"); @@ -1585,10 +1593,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Ads7138::Channel enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Ads7138::Channel const &ch, FormatContext &ctx) { + auto format(espp::Ads7138::Channel const &ch, FormatContext &ctx) const { switch (ch) { case espp::Ads7138::Channel::CH0: return fmt::format_to(ctx.out(), "CH0"); @@ -1615,10 +1625,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of a // std::vector object template <> struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(std::vector const &channels, FormatContext &ctx) { + auto format(std::vector const &channels, FormatContext &ctx) const { std::string result = "{"; for (auto const &ch : channels) { result += fmt::format("{}, ", ch); diff --git a/components/bldc_haptics/include/detent_config.hpp b/components/bldc_haptics/include/detent_config.hpp index c25c70ea8..e51b515fb 100644 --- a/components/bldc_haptics/include/detent_config.hpp +++ b/components/bldc_haptics/include/detent_config.hpp @@ -151,10 +151,12 @@ static const DetentConfig RETURN_TO_CENTER_WITH_DETENTS = { // for allowing easy serialization/printing of the // DetentConfig template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::detail::DetentConfig const &detent_config, FormatContext &ctx) { + auto format(espp::detail::DetentConfig const &detent_config, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "DetentConfig:\n" "\tposition_width: {} radians ({} degrees)\n" diff --git a/components/bldc_motor/include/bldc_types.hpp b/components/bldc_motor/include/bldc_types.hpp index d6e28d324..56832cc37 100644 --- a/components/bldc_motor/include/bldc_types.hpp +++ b/components/bldc_motor/include/bldc_types.hpp @@ -42,10 +42,10 @@ enum class FocType { // for easy printing of enums using fmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(espp::detail::MotionControlType t, FormatContext &ctx) { + auto format(espp::detail::MotionControlType t, FormatContext &ctx) const { switch (t) { case espp::detail::MotionControlType::TORQUE: return fmt::format_to(ctx.out(), "TORQUE"); @@ -64,10 +64,10 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(espp::detail::TorqueControlType t, FormatContext &ctx) { + auto format(espp::detail::TorqueControlType t, FormatContext &ctx) const { switch (t) { case espp::detail::TorqueControlType::VOLTAGE: return fmt::format_to(ctx.out(), "VOLTAGE"); @@ -82,9 +82,9 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(espp::detail::FocType t, FormatContext &ctx) { + template auto format(espp::detail::FocType t, FormatContext &ctx) const { switch (t) { case espp::detail::FocType::SINE_PWM: return fmt::format_to(ctx.out(), "SINE_PWM"); diff --git a/components/bldc_motor/include/sensor_direction.hpp b/components/bldc_motor/include/sensor_direction.hpp index 47b248dd9..c82094604 100644 --- a/components/bldc_motor/include/sensor_direction.hpp +++ b/components/bldc_motor/include/sensor_direction.hpp @@ -19,10 +19,10 @@ enum class SensorDirection { // for printing SensorDirection using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(espp::detail::SensorDirection dir, FormatContext &ctx) { + auto format(espp::detail::SensorDirection dir, FormatContext &ctx) const { switch (dir) { case espp::detail::SensorDirection::CLOCKWISE: return fmt::format_to(ctx.out(), "CLOCKWISE"); diff --git a/components/ble_gatt_server/include/ble_gatt_server.hpp b/components/ble_gatt_server/include/ble_gatt_server.hpp index 246410041..0cb5c351b 100644 --- a/components/ble_gatt_server/include/ble_gatt_server.hpp +++ b/components/ble_gatt_server/include/ble_gatt_server.hpp @@ -685,10 +685,10 @@ class BleGattServer : public BaseComponent { #if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_) // for easy printing of the advertising parameters using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template auto format(const espp::BleGattServer::AdvertisingParameters &advertising_params, - FormatContext &ctx) { + FormatContext &ctx) const { if (advertising_params.directed_address) { return fmt::format_to( ctx.out(), @@ -711,9 +711,9 @@ template <> struct fmt::formatter { // for easy printing of the DisconnectReason enum using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::BleGattServer::DisconnectReason &reason, FormatContext &ctx) { + auto format(const espp::BleGattServer::DisconnectReason &reason, FormatContext &ctx) const { switch (reason) { case espp::BleGattServer::DisconnectReason::UNKNOWN: return fmt::format_to(ctx.out(), "UNKNOWN"); diff --git a/components/bm8563/include/bm8563.hpp b/components/bm8563/include/bm8563.hpp index ed0ea31a6..92fdcad8c 100644 --- a/components/bm8563/include/bm8563.hpp +++ b/components/bm8563/include/bm8563.hpp @@ -192,28 +192,36 @@ class Bm8563 : public BasePeripheral<> { // for allowing easy serialization/printing of the // espp::Bm8563::Date, espp::Bm8563::Time, and espp::Bm8563::DateTime template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Bm8563::Date const &d, FormatContext &ctx) { + template + auto format(espp::Bm8563::Date const &d, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{{.year = {}, .month = {}, .weekday = {}, .day = {}}}", d.year, d.month, d.weekday, d.day); } }; template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Bm8563::Time const &t, FormatContext &ctx) { + template + auto format(espp::Bm8563::Time const &t, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{{.hour = {}, .minute = {}, .second = {}}}", t.hour, t.minute, t.second); } }; template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Bm8563::DateTime const &dt, FormatContext &ctx) { + auto format(espp::Bm8563::DateTime const &dt, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{{.date = {}, .time = {}}}", dt.date, dt.time); } }; diff --git a/components/color/include/color.hpp b/components/color/include/color.hpp index e0c8bf8af..1f2c462dc 100644 --- a/components/color/include/color.hpp +++ b/components/color/include/color.hpp @@ -132,9 +132,11 @@ class Hsv { // for allowing easy serialization/printing of the // Rgb template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Rgb const &rgb, FormatContext &ctx) { + template auto format(espp::Rgb const &rgb, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", rgb.r, rgb.g, rgb.b); } }; @@ -142,9 +144,11 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // Rgb template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Hsv const &hsv, FormatContext &ctx) { + template auto format(espp::Hsv const &hsv, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", hsv.h, hsv.s, hsv.v); } }; diff --git a/components/drv2605/include/drv2605.hpp b/components/drv2605/include/drv2605.hpp index 135214ce5..c8c4d0bae 100644 --- a/components/drv2605/include/drv2605.hpp +++ b/components/drv2605/include/drv2605.hpp @@ -276,9 +276,9 @@ class Drv2605 : public BasePeripheral<> { // for easy printing of the enums with the libfmt library: template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(espp::Drv2605::Mode m, FormatContext &ctx) { + template auto format(espp::Drv2605::Mode m, FormatContext &ctx) const { switch (m) { case espp::Drv2605::Mode::INTTRIG: return fmt::format_to(ctx.out(), "INTTRIG"); @@ -303,9 +303,10 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(espp::Drv2605::Waveform w, FormatContext &ctx) { + template + auto format(espp::Drv2605::Waveform w, FormatContext &ctx) const { switch (w) { case espp::Drv2605::Waveform::END: return fmt::format_to(ctx.out(), "END"); @@ -352,9 +353,10 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(espp::Drv2605::Library l, FormatContext &ctx) { + template + auto format(espp::Drv2605::Library l, FormatContext &ctx) const { switch (l) { case espp::Drv2605::Library::EMPTY: return fmt::format_to(ctx.out(), "EMPTY"); diff --git a/components/esp-box/include/esp-box.hpp b/components/esp-box/include/esp-box.hpp index 536ac1fc7..e5becd162 100644 --- a/components/esp-box/include/esp-box.hpp +++ b/components/esp-box/include/esp-box.hpp @@ -391,7 +391,7 @@ class EspBox : public BaseComponent { // for easy printing of BoxType using libfmt template <> struct fmt::formatter : fmt::formatter { - template auto format(espp::EspBox::BoxType c, FormatContext &ctx) { + template auto format(espp::EspBox::BoxType c, FormatContext &ctx) const { std::string name; switch (c) { case espp::EspBox::BoxType::UNKNOWN: @@ -411,7 +411,7 @@ template <> struct fmt::formatter : fmt::formatter struct fmt::formatter : fmt::formatter { template - auto format(const espp::EspBox::TouchpadData &c, FormatContext &ctx) { + auto format(const espp::EspBox::TouchpadData &c, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "TouchpadData{{num_touch_points={}, x={}, y={}, btn_state={}}}", c.num_touch_points, c.x, c.y, c.btn_state); diff --git a/components/filters/include/biquad_filter.hpp b/components/filters/include/biquad_filter.hpp index 1305cb560..837e400ed 100644 --- a/components/filters/include/biquad_filter.hpp +++ b/components/filters/include/biquad_filter.hpp @@ -151,10 +151,12 @@ class BiquadFilterDf2 { // for allowing easy serialization/printing of the // espp::BiquadFilterDf1 template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::BiquadFilterDf1 const &bqf, FormatContext &ctx) { + auto format(espp::BiquadFilterDf1 const &bqf, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "DF1 - B: {}, A: {}", bqf.b_, bqf.a_); } }; @@ -162,10 +164,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::BiquadFilterDf2 template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::BiquadFilterDf2 const &bqf, FormatContext &ctx) { + auto format(espp::BiquadFilterDf2 const &bqf, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "DF2 - B: {}, A: {}", bqf.b_, bqf.a_); } }; diff --git a/components/filters/include/butterworth_filter.hpp b/components/filters/include/butterworth_filter.hpp index a520592bb..b072c9989 100644 --- a/components/filters/include/butterworth_filter.hpp +++ b/components/filters/include/butterworth_filter.hpp @@ -75,10 +75,12 @@ class ButterworthFilter : public SosFilter<(ORDER + 1) / 2, Impl> { // for allowing easy serialization/printing of the // espp::ButterworthFilter template struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::ButterworthFilter const &f, FormatContext &ctx) { + auto format(espp::ButterworthFilter const &f, FormatContext &ctx) const { auto &&out = ctx.out(); fmt::format_to(out, "Butterworth - ["); if constexpr (ORDER > 0) { diff --git a/components/filters/include/lowpass_filter.hpp b/components/filters/include/lowpass_filter.hpp index 90e95672c..48e0c9fab 100644 --- a/components/filters/include/lowpass_filter.hpp +++ b/components/filters/include/lowpass_filter.hpp @@ -74,9 +74,12 @@ class LowpassFilter { // for allowing easy serialization/printing of the // espp::LowpassFilter template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::LowpassFilter const &f, FormatContext &ctx) { + template + auto format(espp::LowpassFilter const &f, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "Lowpass - {}", f.coeffs_); } }; diff --git a/components/filters/include/simple_lowpass_filter.hpp b/components/filters/include/simple_lowpass_filter.hpp index 23ff25024..ac712ca45 100644 --- a/components/filters/include/simple_lowpass_filter.hpp +++ b/components/filters/include/simple_lowpass_filter.hpp @@ -81,10 +81,12 @@ class SimpleLowpassFilter { // for allowing easy serialization/printing of the // espp::SimpleLowpassFilter template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::SimpleLowpassFilter const &f, FormatContext &ctx) { + auto format(espp::SimpleLowpassFilter const &f, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "SimpleLowpassFilter - {}", f.time_constant_); } }; diff --git a/components/filters/include/sos_filter.hpp b/components/filters/include/sos_filter.hpp index 8d79a422d..4748f794b 100644 --- a/components/filters/include/sos_filter.hpp +++ b/components/filters/include/sos_filter.hpp @@ -57,10 +57,12 @@ template class SosFilter { // for allowing easy serialization/printing of the // espp::SosFilter template struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::SosFilter const &f, FormatContext &ctx) { + auto format(espp::SosFilter const &f, FormatContext &ctx) const { auto &&out = ctx.out(); format_to(out, "SoS - ["); if constexpr (N > 0) { diff --git a/components/filters/include/transfer_function.hpp b/components/filters/include/transfer_function.hpp index 7d72fba56..cd5d2105f 100644 --- a/components/filters/include/transfer_function.hpp +++ b/components/filters/include/transfer_function.hpp @@ -22,10 +22,12 @@ template struct TransferFunction { // for allowing easy serialization/printing of the // espp::TransferFunction template struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::TransferFunction const &tf, FormatContext &ctx) { + auto format(espp::TransferFunction const &tf, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "TransferFunction({}) - B: {}, A: {}", N, tf.b, tf.a); } }; diff --git a/components/format/include/format.hpp b/components/format/include/format.hpp index fac1b3d9c..52382b1d4 100644 --- a/components/format/include/format.hpp +++ b/components/format/include/format.hpp @@ -3,11 +3,11 @@ #include #define FMT_HEADER_ONLY -#include +#include #include -#include -#include -// to print time + #include -// to print files +#include #include +#include +#include diff --git a/components/gfps_service/include/gfps.hpp b/components/gfps_service/include/gfps.hpp index 3a040b5b2..4925bd71b 100644 --- a/components/gfps_service/include/gfps.hpp +++ b/components/gfps_service/include/gfps.hpp @@ -100,9 +100,10 @@ static constexpr espp::Logger::Verbosity LOG_LEVEL = #if CONFIG_BT_NIMBLE_ENABLED || defined(_DOXYGEN_) // for printing of BLE_GAP_EVENT_ using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(const ble_gap_event &event, FormatContext &ctx) { + template + auto format(const ble_gap_event &event, FormatContext &ctx) const { switch (event.type) { case BLE_GAP_EVENT_CONNECT: return fmt::format_to(ctx.out(), "BLE_GAP_EVENT_CONNECT"); @@ -129,10 +130,10 @@ template <> struct fmt::formatter { // for pritning of nearby_fp_Characteristic using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const nearby_fp_Characteristic &characteristic, FormatContext &ctx) { + auto format(const nearby_fp_Characteristic &characteristic, FormatContext &ctx) const { switch (characteristic) { case kModelId: return fmt::format_to(ctx.out(), "kModelId"); diff --git a/components/i2c/include/i2c.hpp b/components/i2c/include/i2c.hpp index 1e94ff683..165e6df17 100644 --- a/components/i2c/include/i2c.hpp +++ b/components/i2c/include/i2c.hpp @@ -292,9 +292,10 @@ class I2c : public espp::BaseComponent { // for printing the I2C::Config using fmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(const espp::I2c::Config &c, FormatContext &ctx) { + template + auto format(const espp::I2c::Config &c, FormatContext &ctx) const { // print the clock speed in khz auto clk_speed_khz = c.clk_speed / 1000; // if it's MHz, print it as such diff --git a/components/i2c/include/i2c_format_helpers.hpp b/components/i2c/include/i2c_format_helpers.hpp index 0fff49672..cb9295cfd 100644 --- a/components/i2c/include/i2c_format_helpers.hpp +++ b/components/i2c/include/i2c_format_helpers.hpp @@ -6,9 +6,9 @@ // for printing of i2c_port_t with libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(const i2c_port_t &p, FormatContext &ctx) { + template auto format(const i2c_port_t &p, FormatContext &ctx) const { switch (p) { case I2C_NUM_0: return fmt::format_to(ctx.out(), "I2C_NUM_0"); @@ -22,18 +22,18 @@ template <> struct fmt::formatter { // for printing gpio_num_t with libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(const gpio_num_t &g, FormatContext &ctx) { + template auto format(const gpio_num_t &g, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{:d}", (int)g); } }; // for printing gpio_pullup_t with libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } - template auto format(const gpio_pullup_t &p, FormatContext &ctx) { + template auto format(const gpio_pullup_t &p, FormatContext &ctx) const { switch (p) { case GPIO_PULLUP_DISABLE: return fmt::format_to(ctx.out(), "GPIO_PULLUP_DISABLE"); diff --git a/components/interrupt/include/interrupt.hpp b/components/interrupt/include/interrupt.hpp index 421a97086..882d38168 100644 --- a/components/interrupt/include/interrupt.hpp +++ b/components/interrupt/include/interrupt.hpp @@ -379,8 +379,8 @@ class Interrupt : public BaseComponent { // for printing the interrupt type using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } - template auto format(espp::Interrupt::Type t, FormatContext &ctx) { + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } + template auto format(espp::Interrupt::Type t, FormatContext &ctx) const { switch (t) { case espp::Interrupt::Type::ANY_EDGE: return fmt::format_to(ctx.out(), "ANY_EDGE"); @@ -399,9 +399,9 @@ template <> struct fmt::formatter { // for printing the active level using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(espp::Interrupt::ActiveLevel t, FormatContext &ctx) { + auto format(espp::Interrupt::ActiveLevel t, FormatContext &ctx) const { switch (t) { case espp::Interrupt::ActiveLevel::LOW: return fmt::format_to(ctx.out(), "LOW"); @@ -414,8 +414,9 @@ template <> struct fmt::formatter { // for printing the FilterType using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } - template auto format(espp::Interrupt::FilterType t, FormatContext &ctx) { + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } + template + auto format(espp::Interrupt::FilterType t, FormatContext &ctx) const { switch (t) { case espp::Interrupt::FilterType::NONE: return fmt::format_to(ctx.out(), "NONE"); @@ -430,9 +431,9 @@ template <> struct fmt::formatter { // for printing the FilterConfig using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Interrupt::FilterConfig &t, FormatContext &ctx) { + auto format(const espp::Interrupt::FilterConfig &t, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "FilterConfig{{window_width_ns={}, window_threshold_ns={}}}", t.window_width_ns, t.window_threshold_ns); } @@ -440,9 +441,9 @@ template <> struct fmt::formatter { // for printing the PinConfig using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Interrupt::PinConfig &t, FormatContext &ctx) { + auto format(const espp::Interrupt::PinConfig &t, FormatContext &ctx) const { return fmt::format_to( ctx.out(), "PinConfig{{gpio_num={}, active_level={}, interrupt_type={}, pullup_enabled={}, " diff --git a/components/kts1622/include/kts1622.hpp b/components/kts1622/include/kts1622.hpp index e00b588ed..59fcb461d 100644 --- a/components/kts1622/include/kts1622.hpp +++ b/components/kts1622/include/kts1622.hpp @@ -492,15 +492,16 @@ class Kts1622 : public BasePeripheral<> { auto addr = Registers::CONFIG0; uint8_t data[] = {0, 0}; read_many_from_register((uint8_t)addr, data, 2, ec); - if (ec) return; + if (ec) + return; if (direction) { - // To Input port - data[0] |= (uint8_t) mask; - data[1] |= (uint8_t)(mask >> 8); + // To Input port + data[0] |= (uint8_t)mask; + data[1] |= (uint8_t)(mask >> 8); } else { - // To Output port - data[0] &= (uint8_t) ~mask; - data[1] &= (uint8_t)(~mask >> 8); + // To Output port + data[0] &= (uint8_t)~mask; + data[1] &= (uint8_t)(~mask >> 8); } write_many_to_register((uint8_t)addr, data, 2, ec); } @@ -722,8 +723,9 @@ class Kts1622 : public BasePeripheral<> { // for printing of enums using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } - template auto format(const espp::Kts1622::Port &p, FormatContext &ctx) { + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } + template + auto format(const espp::Kts1622::Port &p, FormatContext &ctx) const { switch (p) { case espp::Kts1622::Port::PORT0: return fmt::format_to(ctx.out(), "Port 0"); @@ -736,9 +738,9 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Kts1622::InterruptType &t, FormatContext &ctx) { + auto format(const espp::Kts1622::InterruptType &t, FormatContext &ctx) const { switch (t) { case espp::Kts1622::InterruptType::LEVEL: return fmt::format_to(ctx.out(), "Level"); @@ -755,9 +757,9 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Kts1622::OutputDriveMode &m, FormatContext &ctx) { + auto format(const espp::Kts1622::OutputDriveMode &m, FormatContext &ctx) const { switch (m) { case espp::Kts1622::OutputDriveMode::PUSH_PULL: return fmt::format_to(ctx.out(), "Push Pull"); @@ -770,9 +772,9 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Kts1622::OutputDriveStrength &s, FormatContext &ctx) { + auto format(const espp::Kts1622::OutputDriveStrength &s, FormatContext &ctx) const { switch (s) { case espp::Kts1622::OutputDriveStrength::F_0_25: return fmt::format_to(ctx.out(), "0.25x"); @@ -789,9 +791,9 @@ template <> struct fmt::formatter { }; template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Kts1622::PullResistor &p, FormatContext &ctx) { + auto format(const espp::Kts1622::PullResistor &p, FormatContext &ctx) const { switch (p) { case espp::Kts1622::PullResistor::PULL_UP: return fmt::format_to(ctx.out(), "Pull Up"); diff --git a/components/math/include/range_mapper.hpp b/components/math/include/range_mapper.hpp index 6dc137900..16ec3f823 100644 --- a/components/math/include/range_mapper.hpp +++ b/components/math/include/range_mapper.hpp @@ -247,7 +247,7 @@ typedef RangeMapper IntRangeMapper; // errors... template <> struct fmt::formatter : fmt::formatter { - auto format(const espp::FloatRangeMapper::Config &config, format_context &ctx) { + auto format(const espp::FloatRangeMapper::Config &config, format_context &ctx) const { return fmt::format_to(ctx.out(), "FloatRangeMapper[{},{},{},{},{},{},{},{}]", config.center, config.center_deadband, config.minimum, config.maximum, config.range_deadband, config.output_center, config.output_range, @@ -255,7 +255,7 @@ template <> struct fmt::formatter : fmt::formatt } }; template <> struct fmt::formatter : fmt::formatter { - auto format(const espp::IntRangeMapper::Config &config, format_context &ctx) { + auto format(const espp::IntRangeMapper::Config &config, format_context &ctx) const { return fmt::format_to(ctx.out(), "IntRangeMapper[{},{},{},{},{},{},{},{}]", config.center, config.center_deadband, config.minimum, config.maximum, config.range_deadband, config.output_center, config.output_range, diff --git a/components/math/include/vector2d.hpp b/components/math/include/vector2d.hpp index 1bbece54e..495d8d336 100644 --- a/components/math/include/vector2d.hpp +++ b/components/math/include/vector2d.hpp @@ -299,10 +299,12 @@ typedef Vector2d Vector2u8; ///< Typedef for 8 bit integer 2D vectors. // for allowing easy serialization/printing of the // espp::Vector2d template struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Vector2d const &v, FormatContext &ctx) { + auto format(espp::Vector2d const &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({},{})", v.x(), v.y()); } }; diff --git a/components/monitor/include/task_monitor.hpp b/components/monitor/include/task_monitor.hpp index e5b020334..e747e1a2f 100644 --- a/components/monitor/include/task_monitor.hpp +++ b/components/monitor/include/task_monitor.hpp @@ -248,9 +248,9 @@ class TaskMonitor : public BaseComponent { // for printing TaskMonitor::TaskInfo using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::TaskMonitor::TaskInfo &t, FormatContext &ctx) { + auto format(const espp::TaskMonitor::TaskInfo &t, FormatContext &ctx) const { return fmt::format_to( #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID ctx.out(), "TaskInfo(name={}, cpu_percent={}, high_water_mark={}, priority={}, core_id={})", diff --git a/components/mt6701/include/mt6701.hpp b/components/mt6701/include/mt6701.hpp index c2f6f4190..216cf47af 100644 --- a/components/mt6701/include/mt6701.hpp +++ b/components/mt6701/include/mt6701.hpp @@ -422,10 +422,10 @@ class Mt6701 : public BasePeripheral // for easy printing of MagneticFieldStatus using libfmt template <> struct fmt::formatter::MagneticFieldStrength> { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template auto format(espp::Mt6701::MagneticFieldStrength const &mfs, - FormatContext &ctx) { + FormatContext &ctx) const { return fmt::format_to( ctx.out(), "{}", mfs == espp::Mt6701::MagneticFieldStrength::NORMAL ? "NORMAL" @@ -435,20 +435,20 @@ template <> struct fmt::formatter::Magn } }; template <> struct fmt::formatter::TrackingStatus> { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template auto format(espp::Mt6701::TrackingStatus const &ts, - FormatContext &ctx) { + FormatContext &ctx) const { return fmt::format_to( ctx.out(), "{}", ts == espp::Mt6701::TrackingStatus::NORMAL ? "NORMAL" : "LOST"); } }; template <> struct fmt::formatter::MagneticFieldStrength> { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template auto format(espp::Mt6701::MagneticFieldStrength const &mfs, - FormatContext &ctx) { + FormatContext &ctx) const { return fmt::format_to( ctx.out(), "{}", mfs == espp::Mt6701::MagneticFieldStrength::NORMAL ? "NORMAL" @@ -458,10 +458,10 @@ template <> struct fmt::formatter::Magn } }; template <> struct fmt::formatter::TrackingStatus> { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template auto format(espp::Mt6701::TrackingStatus const &ts, - FormatContext &ctx) { + FormatContext &ctx) const { return fmt::format_to( ctx.out(), "{}", ts == espp::Mt6701::TrackingStatus::NORMAL ? "NORMAL" : "LOST"); diff --git a/components/pid/include/pid.hpp b/components/pid/include/pid.hpp index 62e257299..ee3995637 100644 --- a/components/pid/include/pid.hpp +++ b/components/pid/include/pid.hpp @@ -170,9 +170,11 @@ class Pid : public BaseComponent { // for allowing easy serialization/printing of the // espp::Pid template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Pid const &pid, FormatContext &ctx) { + template auto format(espp::Pid const &pid, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{}, {}", pid.get_error(), pid.get_integrator()); } }; @@ -180,9 +182,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Pid::Config template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } - template auto format(espp::Pid::Config const &cfg, FormatContext &ctx) { + template + auto format(espp::Pid::Config const &cfg, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{}, {}, {}, {}, {}, {}, {}", cfg.kp, cfg.ki, cfg.kd, cfg.integrator_min, cfg.integrator_max, cfg.output_min, cfg.output_max); } diff --git a/components/qwiicnes/include/qwiicnes.hpp b/components/qwiicnes/include/qwiicnes.hpp index b61ed7730..4c39a9a73 100644 --- a/components/qwiicnes/include/qwiicnes.hpp +++ b/components/qwiicnes/include/qwiicnes.hpp @@ -183,10 +183,12 @@ static bool operator==(const espp::QwiicNes::ButtonState &lhs, // for allowing easy serialization/printing of the // espp::QwiicNes::ButtonState struct template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::QwiicNes::ButtonState const &v, FormatContext &ctx) { + auto format(espp::QwiicNes::ButtonState const &v, FormatContext &ctx) const { return fmt::format_to( ctx.out(), "a: {}, b: {}, select: {}, start: {}, up: {}, down: {}, left: {}, right: {}", (bool)v.a, (bool)v.b, (bool)v.select, (bool)v.start, (bool)v.up, (bool)v.down, (bool)v.left, diff --git a/components/socket/include/socket.hpp b/components/socket/include/socket.hpp index 728cf4e8e..2075cde3f 100644 --- a/components/socket/include/socket.hpp +++ b/components/socket/include/socket.hpp @@ -424,10 +424,12 @@ class Socket : public BaseComponent { // for allowing easy serialization/printing of the // espp::Socket::Info template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Socket::Info const &info, FormatContext &ctx) { + auto format(espp::Socket::Info const &info, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{}:{}", info.address, info.port); } }; diff --git a/components/st25dv/include/st25dv.hpp b/components/st25dv/include/st25dv.hpp index 71c85b11c..217de5e0f 100644 --- a/components/st25dv/include/st25dv.hpp +++ b/components/st25dv/include/st25dv.hpp @@ -599,10 +599,10 @@ class St25dv : public BasePeripheral { // For printing out the IT_STS register using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::St25dv::IT_STS &it_sts, FormatContext &ctx) { + auto format(const espp::St25dv::IT_STS &it_sts, FormatContext &ctx) const { return fmt::format_to( ctx.out(), "IT_STS(raw: {:#02x}){{RF_USER: {}, RF_ACTIVITY: {}, RF_INTTERUPT: {}, FIELD_FALLING: {}, " diff --git a/components/task/include/task.hpp b/components/task/include/task.hpp index fe2797582..cd2dd3a91 100644 --- a/components/task/include/task.hpp +++ b/components/task/include/task.hpp @@ -457,10 +457,10 @@ class Task : public BaseComponent { // for printing of BaseConfig using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Task::BaseConfig &config, FormatContext &ctx) { + auto format(const espp::Task::BaseConfig &config, FormatContext &ctx) const { return fmt::format_to( ctx.out(), "Task::BaseConfig{{name: '{}', stack_size_bytes: {}, priority: {}, core_id: {}}}", @@ -470,10 +470,10 @@ template <> struct fmt::formatter { // for printing of Task::Config using libfmt template <> struct fmt::formatter { - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template - auto format(const espp::Task::Config &config, FormatContext &ctx) { + auto format(const espp::Task::Config &config, FormatContext &ctx) const { return fmt::format_to( ctx.out(), "Task::Config{{name: '{}', stack_size_bytes: {}, priority: {}, core_id: {}}}", config.name, config.stack_size_bytes, config.priority, config.core_id); diff --git a/components/tla2528/include/tla2528.hpp b/components/tla2528/include/tla2528.hpp index 9cb21cd1f..e8a0f8798 100644 --- a/components/tla2528/include/tla2528.hpp +++ b/components/tla2528/include/tla2528.hpp @@ -908,10 +908,12 @@ class Tla2528 : public BasePeripheral<> { // for allowing easy serialization/printing of the // espp::Tla2528::OverSamplingRatio enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Tla2528::OversamplingRatio const &ratio, FormatContext &ctx) { + auto format(espp::Tla2528::OversamplingRatio const &ratio, FormatContext &ctx) const { switch (ratio) { case espp::Tla2528::OversamplingRatio::NONE: return fmt::format_to(ctx.out(), "NONE"); @@ -938,10 +940,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Mode enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Tla2528::Mode const &mode, FormatContext &ctx) { + auto format(espp::Tla2528::Mode const &mode, FormatContext &ctx) const { switch (mode) { case espp::Tla2528::Mode::MANUAL: return fmt::format_to(ctx.out(), "MANUAL"); @@ -956,10 +960,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::DataFormat enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Tla2528::DataFormat const &format, FormatContext &ctx) { + auto format(espp::Tla2528::DataFormat const &format, FormatContext &ctx) const { switch (format) { case espp::Tla2528::DataFormat::RAW: return fmt::format_to(ctx.out(), "RAW"); @@ -974,10 +980,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Append enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Tla2528::Append const &format, FormatContext &ctx) { + auto format(espp::Tla2528::Append const &format, FormatContext &ctx) const { switch (format) { case espp::Tla2528::Append::NONE: return fmt::format_to(ctx.out(), "NONE"); @@ -992,10 +1000,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Channel enum template <> struct fmt::formatter { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(espp::Tla2528::Channel const &ch, FormatContext &ctx) { + auto format(espp::Tla2528::Channel const &ch, FormatContext &ctx) const { switch (ch) { case espp::Tla2528::Channel::CH0: return fmt::format_to(ctx.out(), "CH0"); @@ -1022,10 +1032,12 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of a // std::vector object template <> struct fmt::formatter> { - template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } + template constexpr auto parse(ParseContext &ctx) const { + return ctx.begin(); + } template - auto format(std::vector const &channels, FormatContext &ctx) { + auto format(std::vector const &channels, FormatContext &ctx) const { std::string result = "{"; for (auto const &ch : channels) { result += fmt::format("{}, ", ch); diff --git a/external/fmt b/external/fmt index c4283ec47..0041a40c1 160000 --- a/external/fmt +++ b/external/fmt @@ -1 +1 @@ -Subproject commit c4283ec471bd3efdb114bc1ab30c7c7c5e5e0ee0 +Subproject commit 0041a40c1350ba702d475b9c4ad62da77caea164