Use a common function for finding Tone Key index from received Tone Frequency (#1218)

* Common function for finding CTCSS tone index from freq
This commit is contained in:
Mark Thompson 2023-06-30 00:37:43 -05:00 committed by GitHub
parent 99809c7919
commit cdd524b9f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 75 deletions

View file

@ -30,7 +30,7 @@ using namespace ui;
namespace tonekey {
typedef int16_t tone_index;
typedef int32_t tone_index;
using tone_key_t = std::vector<std::pair<std::string, float>>;
@ -40,8 +40,8 @@ void tone_keys_populate(OptionsField& field);
float tone_key_frequency(const tone_index index);
std::string tone_key_string(const tone_index index);
tone_index tone_key_index_by_string(char* str);
// tone_index tone_key_index_by_value( int32_t freq );
std::string tone_key_string_by_value(uint32_t value);
tone_index tone_key_index_by_value(uint32_t value);
} // namespace tonekey