Fixed multiple bugs and errors.
- Added WARNING handler - put voltage calculations to dedicated module fixed last errors. Updated menu repair screen without ERROR from PID This is version 0.9.0.3, which is used for the first duration test Will also be tagged git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@272 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -57,21 +57,15 @@
|
||||
// Function definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ErrorStatus DACDevice_construct(struct DACDevice* self, DACWriteFunction write, unsigned int resolutionInBits)
|
||||
ErrorStatus DACDevice_construct(struct DACDevice* self, DACWriteFunction write, DACReadbackFunction readback, unsigned int resolutionInBits)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
if (!self->initialized)
|
||||
{
|
||||
if (write != NULL)
|
||||
{
|
||||
self->_write = write;
|
||||
self->_readback = readback;
|
||||
self->resolutionInBits = resolutionInBits;
|
||||
self->initialized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -111,3 +105,26 @@ ErrorStatus DACDevice_write(const struct DACDevice* self, uint32_t voltage)
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32_t DACDevice_getCurrentValue(const struct DACDevice* self)
|
||||
{
|
||||
uint32_t returnValue = SUCCESS;
|
||||
if (self->initialized)
|
||||
{
|
||||
if (self->_readback != NULL)
|
||||
{
|
||||
returnValue = self->_readback(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = 0;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user