mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-18 07:12:03 +00:00
Fixed 0.1Hz error in tone key frequencies 146.2, 156.7, and 162.2 (#1427)
* Fixed tone key freq truncation in float->int conversion * Round integer division when displaying tone key freq
This commit is contained in:
@@ -31,7 +31,7 @@ namespace tonekey {
|
||||
|
||||
#define TONE_FREQ_TOLERANCE_CENTIHZ (4 * 100)
|
||||
#define TONE_DISPLAY_TOGGLE_COUNTER 3
|
||||
#define F2Ix100(x) (int32_t)(x * 100.0)
|
||||
#define F2Ix100(x) (int32_t)(x * 100.0 + 0.5) // add 0.5f to round vs truncate during FP->int conversion
|
||||
|
||||
using tone_index = int32_t;
|
||||
using tone_key_t = std::vector<std::pair<std::string, uint32_t>>;
|
||||
|
Reference in New Issue
Block a user