Skip to content

Commit

Permalink
Removed unnecessary using namespace pros::c from cpp file.
Browse files Browse the repository at this point in the history
  • Loading branch information
WillXuCodes authored and WillXuCodes committed Sep 29, 2020
1 parent 7e73e49 commit cfd8e38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/devices/vdml_distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,36 @@
#include "vdml/registry.h"
#include "vdml/vdml.h"

#define ERROR_DISTANCE_BAD_PORT(port, err_return) \
if (vexDistanceStatusGet(port) == 0x82 || vexDistanceStatusGet(port) == 0x82) { \
#define ERROR_DISTANCE_BAD_PORT(device, err_return) \
if (vexDistanceStatusGet(device->device_info) == 0x82 || vexDistanceStatusGet(device->device_info) == 0x82) { \
errno = EAGAIN; \
return_port(port - 1, err_return); \
}

int32_t distance_get(uint8_t port) {
claim_port_i(port - 1, E_DEVICE_DISTANCE);
ERROR_DISTANCE_BAD_PORT(port, PROS_ERR);
ERROR_DISTANCE_BAD_PORT(device, PROS_ERR);
int32_t rtn = vexDistanceDistanceGet(port - 1);
return_port(port - 1, rtn);
}

int32_t distance_get_confidence(uint8_t port) {
claim_port_i(port - 1, E_DEVICE_DISTANCE);
ERROR_DISTANCE_BAD_PORT(port, PROS_ERR);
ERROR_DISTANCE_BAD_PORT(device, PROS_ERR);
int32_t rtn = vexDistanceConfidenceGet(port - 1);
return_port(port - 1, rtn);
}

int32_t distance_get_object_size(uint8_t port){
claim_port_i(port - 1, E_DEVICE_DISTANCE);
ERROR_DISTANCE_BAD_PORT(port, PROS_ERR);
ERROR_DISTANCE_BAD_PORT(device, PROS_ERR);
int32_t rtn = vexDistanceObjectSizeGet(port - 1);
return_port(port - 1, rtn);
}

double distance_get_object_velocity(uint8_t port){
claim_port_i(port - 1, E_DEVICE_DISTANCE);
ERROR_DISTANCE_BAD_PORT(port, PROS_ERR);
ERROR_DISTANCE_BAD_PORT(device, PROS_ERR);
int32_t rtn = vexDistanceObjectVelocityGet(port - 1);
return_port(port - 1, rtn);
}
1 change: 0 additions & 1 deletion src/devices/vdml_distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "pros/distance.hpp"

namespace pros {
using namespace pros::c;

Distance::Distance(const std::uint8_t port):_port(port){}

Expand Down

0 comments on commit cfd8e38

Please sign in to comment.