Skip to content

Commit

Permalink
indi-asi-power v0.94 Minor fix to return codes (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-self committed Mar 24, 2021
1 parent 708fc22 commit 8815d2d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
6 changes: 6 additions & 0 deletions debian/indi-asi-power/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
indi-asi-power (0.94) buster; urgency=medium

* Minor fix to return codes

-- Ken Self <ken.kgself@gmail.com> Wed, 24 Mar 2021 11:00:00 +1100

indi-asi-power (0.93) buster; urgency=medium

* Split from pigpiod servce/library
Expand Down
2 changes: 1 addition & 1 deletion indi-asi-power/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
include(GNUInstallDirs)

set (VERSION_MAJOR 0)
set (VERSION_MINOR 93)
set (VERSION_MINOR 94)

find_package(INDI REQUIRED)
find_package(Threads REQUIRED)
Expand Down
6 changes: 6 additions & 0 deletions indi-asi-power/Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.94
* Minor fix to return codes

v0.93
* Split from pigpiod servce/library

v0.92
* Fix install for Raspbian - clash with pigpiod
* Minor fix to messages
Expand Down
17 changes: 11 additions & 6 deletions indi-asi-power/asipower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ bool IndiAsiPower::ISNewNumber (const char *dev, const char *name, double values
return false;
}
IUUpdateNumber(&DutyCycleNP[i],values,names,n);
DutyCycleNP[i].s = IPS_OK;
IDSetNumber(&DutyCycleNP[i], nullptr);
DEBUGF(INDI::Logger::DBG_SESSION, "%s %s set to duty cycle %0.0f", DeviceSP[i].label, dev_type[m_type[i]].c_str(), DutyCycleN[i][0].value);

// If the device is ON and it is a PWM device then apply the duty cycle
Expand All @@ -259,6 +257,8 @@ bool IndiAsiPower::ISNewNumber (const char *dev, const char *name, double values
DEBUGF(INDI::Logger::DBG_SESSION, "%s %s PWM ON %0.0f\%", DeviceSP[i].label, dev_type[m_type[i]].c_str(), DutyCycleN[i][0].value);
set_PWM_dutycycle(m_piId, gpio_pin[i], DutyCycleN[i][0].value);
}
DutyCycleNP[i].s = IPS_OK;
IDSetNumber(&DutyCycleNP[i], nullptr);
return true;
}
}
Expand All @@ -274,7 +274,6 @@ bool IndiAsiPower::ISNewNumber (const char *dev, const char *name, double values
}
double intpart;
IUUpdateNumber(&DslrExpNP,values,names,n);
DslrExpNP.s = IPS_OK;
if(DslrExpN[0].value > 5 && modf(DslrExpN[0].value, &intpart) > 0)
{
DEBUGF(INDI::Logger::DBG_WARNING, "DSLR Duration %0.2f > 5.0 s rounded to nearest integer", DslrExpN[0].value);
Expand All @@ -289,8 +288,10 @@ bool IndiAsiPower::ISNewNumber (const char *dev, const char *name, double values
DEBUGF(INDI::Logger::DBG_WARNING, "DSLR Delay %0.2f > 5.0 rounded to nearest integer", DslrExpN[2].value);
DslrExpN[2].value = round(DslrExpN[2].value);
}
IDSetNumber(&DslrExpNP, nullptr);
DEBUGF(INDI::Logger::DBG_SESSION, "DSLR Duration %0.2f s Count %0.0f Delay %0.2f s", DslrExpN[0].value, DslrExpN[1].value, DslrExpN[2].value);
DslrExpNP.s = IPS_OK;
IDSetNumber(&DslrExpNP, nullptr);
return true;
}
}
return INDI::DefaultDevice::ISNewNumber(dev,name,values,names,n);
Expand All @@ -307,8 +308,6 @@ bool IndiAsiPower::ISNewSwitch (const char *dev, const char *name, ISState *stat
{
IUUpdateSwitch(&DeviceSP[i], states, names, n);
m_type[i] = IUFindOnSwitchIndex(&DeviceSP[i]);
DeviceSP[i].s = IPS_OK;
IDSetSwitch(&DeviceSP[i], NULL);
DEBUGF(INDI::Logger::DBG_SESSION, "%s New Type %s", DeviceSP[i].label, dev_type[m_type[i]].c_str());
if(dev_pwm[m_type[i]])
{
Expand All @@ -334,6 +333,9 @@ bool IndiAsiPower::ISNewSwitch (const char *dev, const char *name, ISState *stat
}
DEBUGF(INDI::Logger::DBG_SESSION, "%d%% duty cycle set on %s %s", max_pwm_duty, DeviceSP[i].label, dev_type[m_type[i]].c_str() );
}
DeviceSP[i].s = IPS_OK;
IDSetSwitch(&DeviceSP[i], NULL);
return true;
}
// handle on/off for device i
if (!strcmp(name, OnOffSP[i].name))
Expand Down Expand Up @@ -381,6 +383,9 @@ bool IndiAsiPower::ISNewSwitch (const char *dev, const char *name, ISState *stat
IDSetSwitch(&OnOffSP[i], NULL);
return true;
}
OnOffSP[i].s = IPS_ALERT;
IDSetSwitch(&OnOffSP[i], nullptr);
return false;
}
}
// Start and stop exposures
Expand Down

0 comments on commit 8815d2d

Please sign in to comment.