Skip to content

Commit

Permalink
Fix TEC temperature range initialisation (missing cast, missing scali…
Browse files Browse the repository at this point in the history
…ng), set 0 degree as starting point instead of indicated minimum.
  • Loading branch information
ukuehn committed Jul 22, 2024
1 parent d455a98 commit a7566b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions indi-toupbase/indi_toupbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,10 @@ bool ToupBase::Connect()
{
int tecRange = 0;
FP(get_Option(m_Handle, CP(OPTION_TECTARGET_RANGE), &tecRange));
TemperatureN[0].min = TemperatureN[0].value = tecRange & 0xffff;
TemperatureN[0].max = (tecRange >> 16) & 0xffff;
TemperatureN[0].min = (static_cast<short>(tecRange & 0xffff))/10.0;
TemperatureN[0].max
= (static_cast<short>((tecRange >> 16) & 0xffff)) / 10.0;
TemperatureN[0].value = 0; // reasonable default
}

{
Expand Down

0 comments on commit a7566b9

Please sign in to comment.