Skip to content

Commit

Permalink
EPM driver logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Jun 21, 2016
1 parent 694db66 commit b473ff3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/AP_EPM/AP_EPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <AP_BoardConfig/AP_BoardConfig.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstdio>


extern const AP_HAL::HAL& hal;

Expand Down Expand Up @@ -80,7 +82,8 @@ void AP_EPM::init()
}

_uavcan_fd = open(UAVCAN_NODE_FILE, 0);
hal.console->printf("EPM: UAVCAN fd %d\n", _uavcan_fd);
// http://ardupilot.org/dev/docs/learning-ardupilot-uarts-and-the-console.html
::printf("EPM: UAVCAN fd %d\n", _uavcan_fd);

// initialise the EPM to the neutral position
neutral();
Expand All @@ -102,6 +105,7 @@ void AP_EPM::grab()
_last_grab_or_release = AP_HAL::millis();

if (should_use_uavcan()) {
::printf("EPM: UAVCAN GRAB\n");
const UAVCANCommand cmd = make_uavcan_command(1);
(void)ioctl(_uavcan_fd, UAVCAN_IOCS_HARDPOINT_SET, reinterpret_cast<unsigned long>(&cmd));
} else {
Expand All @@ -126,6 +130,7 @@ void AP_EPM::release()
_last_grab_or_release = AP_HAL::millis();

if (should_use_uavcan()) {
::printf("EPM: UAVCAN RELEASE\n");
const UAVCANCommand cmd = make_uavcan_command(0);
(void)ioctl(_uavcan_fd, UAVCAN_IOCS_HARDPOINT_SET, reinterpret_cast<unsigned long>(&cmd));
} else {
Expand Down

0 comments on commit b473ff3

Please sign in to comment.