Skip to content

Commit

Permalink
Trill: fixed rescaling when numBits > 12
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Sep 13, 2022
1 parent caba8c0 commit 01afe3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/Trill/Trill.cpp
Expand Up @@ -288,7 +288,8 @@ int Trill::identify() {

void Trill::updateRescale()
{
float scale = 1 << (12 - numBits);
enum { kRescaleFactorsComputedAtBits = 12 };
float scale = (1 << (16 - numBits)) / float(1 << (16 - kRescaleFactorsComputedAtBits));
posRescale = 1.f / trillRescaleFactors[device_type_].pos;
posHRescale = 1.f / trillRescaleFactors[device_type_].posH;
sizeRescale = scale / trillRescaleFactors[device_type_].size;
Expand Down

0 comments on commit 01afe3e

Please sign in to comment.