Skip to content

Commit

Permalink
Merge pull request #590 from elbeno/work-around-the-____ing-parser-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevalenty authored Aug 5, 2024
2 parents c8da90d + f36cb71 commit 875007c
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions include/log/catalog/mipi_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,31 @@ template <typename S> constexpr auto to_module() {
namespace logging::mipi {
namespace defn {
using msg::at;
using msg::dword_index_t;
using msg::field;
using msg::message;
using msg::operator""_dw;
using msg::operator""_msb;
using msg::operator""_lsb;

enum struct type : uint8_t { Build = 0, Short32 = 1, Catalog = 3 };
enum struct build_subtype : uint8_t { Compact32 = 0, Compact64 = 1, Long = 2 };
enum struct catalog_subtype : uint8_t { Id32_Pack32 = 1 };

using type_f = field<"type", type>::located<at{0_dw, 3_msb, 0_lsb}>;
using opt_len_f = field<"opt_len", bool>::located<at{0_dw, 9_msb, 9_lsb}>;
using type_f = field<"type", type>::located<at{dword_index_t{0}, 3_msb, 0_lsb}>;
using opt_len_f =
field<"opt_len", bool>::located<at{dword_index_t{0}, 9_msb, 9_lsb}>;
using payload_len_f =
field<"payload_len", std::uint16_t>::located<at{1_dw, 15_msb, 0_lsb}>;
field<"payload_len",
std::uint16_t>::located<at{dword_index_t{1}, 15_msb, 0_lsb}>;

using build_subtype_f =
field<"subtype", build_subtype>::located<at{0_dw, 29_msb, 24_lsb}>;
using compact32_build_id_f =
field<"build_id", std::uint32_t>::located<at{0_dw, 31_msb, 30_lsb},
at{0_dw, 23_msb, 4_lsb}>;
field<"subtype",
build_subtype>::located<at{dword_index_t{0}, 29_msb, 24_lsb}>;
using compact32_build_id_f = field<"build_id", std::uint32_t>::located<
at{dword_index_t{0}, 31_msb, 30_lsb}, at{dword_index_t{0}, 23_msb, 4_lsb}>;
using compact64_build_id_f = field<"build_id", std::uint64_t>::located<
at{1_dw, 31_msb, 0_lsb}, at{0_dw, 31_msb, 30_lsb}, at{0_dw, 23_msb, 4_lsb}>;
at{dword_index_t{1}, 31_msb, 0_lsb}, at{dword_index_t{0}, 31_msb, 30_lsb},
at{dword_index_t{0}, 23_msb, 4_lsb}>;

using normal_build_msg_t =
message<"normal_build", type_f::with_required<type::Build>,
Expand All @@ -88,16 +91,19 @@ using compact64_build_msg_t =
compact64_build_id_f>;

using short32_payload_f =
field<"payload", std::uint32_t>::located<at{0_dw, 31_msb, 4_lsb}>;
field<"payload",
std::uint32_t>::located<at{dword_index_t{0}, 31_msb, 4_lsb}>;
using short32_msg_t =
message<"short32", type_f::with_required<type::Short32>, short32_payload_f>;

using catalog_subtype_f =
field<"subtype", catalog_subtype>::located<at{0_dw, 29_msb, 24_lsb}>;
using severity_f =
field<"severity", std::uint8_t>::located<at{0_dw, 6_msb, 4_lsb}>;
field<"subtype",
catalog_subtype>::located<at{dword_index_t{0}, 29_msb, 24_lsb}>;
using severity_f = field<"severity", std::uint8_t>::located<at{dword_index_t{0},
6_msb, 4_lsb}>;
using module_id_f =
field<"module_id", std::uint8_t>::located<at{0_dw, 22_msb, 16_lsb}>;
field<"module_id",
std::uint8_t>::located<at{dword_index_t{0}, 22_msb, 16_lsb}>;

using catalog_msg_t =
message<"catalog", type_f::with_required<type::Catalog>, severity_f,
Expand Down

0 comments on commit 875007c

Please sign in to comment.