Skip to content

Commit

Permalink
hotfix q2usb to delay call to DIO.set_directions until on_open()
Browse files Browse the repository at this point in the history
  • Loading branch information
epezent committed Sep 29, 2018
1 parent 3d9cb0e commit bbc979c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MEL/Daq/Quanser/Q2Usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Q2Usb::Q2Usb(QuanserOptions options, uint32 id) :
AI.set_channel_numbers({ 0,1 });
AO.set_channel_numbers({ 0,1 });
DIO.set_channel_numbers({ 0, 1, 2, 3, 4, 5, 6, 7, 8 });
DIO.set_directions({ In,In,In,In,In,In,In,In,Out });
}


Expand All @@ -56,6 +55,8 @@ bool Q2Usb::on_open() {
watchdog.stop();
// clear the watchdog (precautionary, ok if fails)
watchdog.clear();
// set DIO directions (all DIO In, LED Out)
DIO.set_directions({ In,In,In,In,In,In,In,In,Out });
// set default expire values (digital = LOW, analog = 0.0V)
if (!AO.set_expire_values(std::vector<Voltage>(2, 0.0))) {
close();
Expand Down

0 comments on commit bbc979c

Please sign in to comment.