diff --git a/V203/hello/morse.cpp b/V203/hello/morse.cpp index e20c725..4803136 100644 --- a/V203/hello/morse.cpp +++ b/V203/hello/morse.cpp @@ -22,7 +22,8 @@ static constexpr unsigned slen (const char * const str) { while (str[n]) n++; return n; } -static constexpr unsigned char compress (const unsigned n) { +static const TABLE compressed_table + ([](const unsigned n) -> auto { const char * const ptr = morse_code [n]; const unsigned len = slen (ptr); unsigned char mb = 0u; @@ -32,8 +33,7 @@ static constexpr unsigned char compress (const unsigned n) { if (ptr [n] == '-') mb |= (1u << n); } return mb; -} -static const TABLE compressed_table (compress); +}); extern void print_morse_table (const TABLE & tab); Morse::Morse(const GpioClass & pin, const unsigned int ms) noexcept : unit (ms), led (pin),