mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
various fixes (#129)
* various fixes: - add folder for firmware known as working with hyperion - rs232: add debug message for close and do not repeat "port not found" message more than neccessary - v4l2: fix grabber started on creation when set to disabled - cmake: add new platform x86-dev - this as most code coverage and is usefull for test/development. This is not for release * add hints for effect-args
This commit is contained in:
@@ -9,19 +9,23 @@
|
||||
// Local Hyperion includes
|
||||
#include "LedRs232Device.h"
|
||||
|
||||
LedRs232Device::LedRs232Device(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms) :
|
||||
_deviceName(outputDevice),
|
||||
_baudRate_Hz(baudrate),
|
||||
_delayAfterConnect_ms(delayAfterConnect_ms),
|
||||
_rs232Port(this),
|
||||
_blockedForDelay(false)
|
||||
LedRs232Device::LedRs232Device(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms)
|
||||
: _deviceName(outputDevice)
|
||||
, _baudRate_Hz(baudrate)
|
||||
, _delayAfterConnect_ms(delayAfterConnect_ms)
|
||||
, _rs232Port(this)
|
||||
, _blockedForDelay(false)
|
||||
, _stateChanged(true)
|
||||
{
|
||||
}
|
||||
|
||||
LedRs232Device::~LedRs232Device()
|
||||
{
|
||||
if (_rs232Port.isOpen())
|
||||
{
|
||||
_rs232Port.close();
|
||||
Debug(_log,"Close UART: %s", _deviceName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +44,17 @@ bool LedRs232Device::tryOpen()
|
||||
{
|
||||
if ( ! _rs232Port.open(QIODevice::WriteOnly) )
|
||||
{
|
||||
Error(_log, "Unable to open RS232 device (%s)", _deviceName.c_str());
|
||||
if ( _stateChanged )
|
||||
{
|
||||
Error(_log, "Unable to open RS232 device (%s)", _deviceName.c_str());
|
||||
_stateChanged = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
_rs232Port.setBaudRate(_baudRate_Hz);
|
||||
_stateChanged = true;
|
||||
}
|
||||
|
||||
|
||||
if (_delayAfterConnect_ms > 0)
|
||||
{
|
||||
_blockedForDelay = true;
|
||||
|
@@ -66,4 +66,6 @@ private:
|
||||
QSerialPort _rs232Port;
|
||||
|
||||
bool _blockedForDelay;
|
||||
|
||||
bool _stateChanged;
|
||||
};
|
||||
|
Reference in New Issue
Block a user