Skip to content
Permalink
Browse files

Fix comments by peternewman to improve code aesthetics

  • Loading branch information...
aroffringa committed Jun 29, 2019
1 parent 0b2a877 commit c662b14a8252640c07a579427641d1b12c7c538f
Showing with 8 additions and 7 deletions.
  1. +5 −4 plugins/usbdmx/EurolitePro.cpp
  2. +2 −2 plugins/usbdmx/UsbDmxPlugin.cpp
  3. +1 −1 plugins/usbdmx/UsbDmxPlugin.h
@@ -47,6 +47,7 @@ static const uint8_t START_OF_MESSAGE = 0x7e;
static const uint8_t END_OF_MESSAGE = 0xe7;
static const unsigned char ENDPOINT = 0x02;
static const uint8_t MK2_SET_BAUD_RATE = 0x03;
static const unsigned int MK2_TIMEOUT_MS = 500;
enum { EUROLITE_PRO_FRAME_SIZE = 518 };

/*
@@ -180,7 +181,7 @@ bool SynchronousEurolitePro::Init() {

// USB-DMX512-PRO MK2: set baudrate to 250000
if (m_is_mk2) {
uint16_t divisor = 12; // = 3000000 / 250000
uint16_t divisor = 3000000 / 250000;
uint16_t value = divisor; // divisor & 0xFFFF
uint16_t index = (divisor >> 8) & 0xFF00;
int err = m_adaptor->ControlTransfer(
@@ -192,7 +193,7 @@ bool SynchronousEurolitePro::Init() {
index, // wIndex
NULL, // data
0, // wLength
500); // timeout
MK2_TIMEOUT_MS); // timeout
if (err) {
return false;
}
@@ -241,7 +242,7 @@ class EuroliteProAsyncUsbSender : public AsyncUsbSender {

// USB-DMX512-PRO MK2: set baudrate to 250000
if (m_is_mk2) {
uint16_t divisor = 12; // = 3000000 / 250000
uint16_t divisor = 3000000 / 250000;
uint16_t value = divisor; // divisor & 0xFFFF
uint16_t index = (divisor >> 8) & 0xFF00;
int err = m_adaptor->ControlTransfer(
@@ -253,7 +254,7 @@ class EuroliteProAsyncUsbSender : public AsyncUsbSender {
index, // wIndex
NULL, // data
0, // wLength
500); // timeout
MK2_TIMEOUT_MS); // timeout
if (err) {
return NULL;
}
@@ -112,9 +112,9 @@ bool UsbDmxPlugin::SetDefaultPreferences() {
void UsbDmxPlugin::ConflictsWith(
std::set<ola_plugin_id>* conflicting_plugins) const {
if (EuroliteProFactory::IsEuroliteMk2Enabled(m_preferences)) {
conflicting_plugins->insert(OLA_PLUGIN_USBPRO);
conflicting_plugins->insert(OLA_PLUGIN_STAGEPROFI);
conflicting_plugins->insert(OLA_PLUGIN_FTDIDMX);
conflicting_plugins->insert(OLA_PLUGIN_STAGEPROFI);
conflicting_plugins->insert(OLA_PLUGIN_USBPRO);
}
}

@@ -62,7 +62,7 @@ class UsbDmxPlugin: public ola::Plugin {
std::string PluginPrefix() const { return PLUGIN_PREFIX; }

void ConflictsWith(
std::set<ola_plugin_id>* conflicting_plugins) const;
std::set<ola_plugin_id>* conflicting_plugins) const;

private:
std::auto_ptr<class PluginImplInterface> m_impl;

0 comments on commit c662b14

Please sign in to comment.
You can’t perform that action at this time.