Finished initial uart code, it compiles.
The next task is writting unit tests for it.
Also fixed some minor issues in Brian's code.
Finally, fixed a minor problem in download_externals.sh
that was causing things not to build properly.
diff --git a/frc971/atom_code/atom_code.gyp b/frc971/atom_code/atom_code.gyp
index 780ca23..a004c4d 100644
--- a/frc971/atom_code/atom_code.gyp
+++ b/frc971/atom_code/atom_code.gyp
@@ -25,6 +25,7 @@
#'camera/camera.gyp:frc971',
'../../gyro_board/src/libusb-driver/libusb-driver.gyp:get',
'../input/input.gyp:gyro_sensor_receiver',
+ '<(DEPTH)/bbb_cape/src/bbb/bbb.gyp:uart_receiver',
],
'copies': [
{
diff --git a/frc971/input/uart_receiver.cc b/frc971/input/uart_receiver.cc
deleted file mode 100644
index 29aba81..0000000
--- a/frc971/input/uart_receiver.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <fcntl.h>
-#include <termios.h>
-#include <unistd.h>
-
-#include "bbb_cape/src/cape/cows.h"
-#include "uart_receiver.h"
-
-// This is the code for receiving data from the cape via UART.
-// NOTE: In order for this to work, you MUST HAVE "capemgr.enable_partno=BB_UART1"
-// in your BBB's /media/BEAGLEBONE/uEnv.txt file!
-
-int UartReceiver::ReadUart(size_t packet_size) {
- termios cape;
- char byte_in[packet_size];
- int fd, bread;
-
- if ((fd = open("/dev/ttyO1", O_RDWR | O_NOCTTY)) < 0) {
- LOG(FATAL, "Open() failed with error %d.
- (Did you read my note in uart_receiver.cc?)\n", fd);
- }
-
- if ((ret = tcgetattr(fd, &cape)) != 0) {
- LOG(ERROR, "Tcgetattr() failed with error %d.\n", ret);
- return -1;
- }
-}
diff --git a/frc971/input/uart_receiver.h b/frc971/input/uart_receiver.h
deleted file mode 100644
index 171c54c..0000000
--- a/frc971/input/uart_receiver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef FCR971_INPUT_UART_RECEIVER_H_
-#define FRC971_INPUT_UART_RECEIVER_H_
-
-namespace frc971 {
-
- class UartReceiver {
- int ReadUart();
-
- };
-
-} //frc971
-
-#endif