Removed extra file, and fixed USB not sending bug.
diff --git a/gyro_board/src/libusb-driver/get.cc b/gyro_board/src/libusb-driver/get.cc
index f2ad2f8..b50b9ea 100644
--- a/gyro_board/src/libusb-driver/get.cc
+++ b/gyro_board/src/libusb-driver/get.cc
@@ -154,6 +154,7 @@
uint8_t *data_pointer = data;
memcpy(&real_data, &data_pointer, sizeof(data_pointer));
+ int count = 0;
while (should_continue()) {
r = dev_handle_->interrupt_transfer(
0x81, data, sizeof(data), &actual, 1000);
@@ -165,6 +166,10 @@
if (r != 0) {
LOG(ERROR, "Read Error. Read %d\n", actual);
}
+
+ ++count;
+ if (count < 100) continue;
+ count = 0;
printf("angle: %"PRId64"\n", real_data->gyro_angle);
printf("drivel: %d\n", real_data->left_drive);
diff --git a/gyro_board/src/usb/LPCUSB/USB_SENSOR_STREAM.c b/gyro_board/src/usb/LPCUSB/USB_SENSOR_STREAM.c
index 394ade0..576977f 100644
--- a/gyro_board/src/usb/LPCUSB/USB_SENSOR_STREAM.c
+++ b/gyro_board/src/usb/LPCUSB/USB_SENSOR_STREAM.c
@@ -288,7 +288,7 @@
// data available, enable NAK interrupt on bulk in
USBHwNakIntEnable(INACK_BI | INACK_II);
}else{
- USBHwNakIntEnable(INACK_BI);
+ USBHwNakIntEnable(INACK_II);
}
}
diff --git a/gyro_board/src/usb/Makefile b/gyro_board/src/usb/Makefile
index 8bf7da3..afdb82f 100644
--- a/gyro_board/src/usb/Makefile
+++ b/gyro_board/src/usb/Makefile
@@ -13,7 +13,7 @@
endif
GCC_PATH=$(TOOLS_PREFIX)/bin
-PORT=/dev/ttyS1
+PORT=/dev/ttyUSB0
CC=$(GCC_PATH)/arm-eabi-gcc
LD=$(GCC_PATH)/arm-eabi-ld
diff --git a/gyro_board/src/usb/quad encoder config.txt b/gyro_board/src/usb/quad encoder config.txt
deleted file mode 100644
index 6f6ecf5..0000000
--- a/gyro_board/src/usb/quad encoder config.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-// Quad Encoder stuff
-
-
-// enable the quadrature encode peripheral and peripherial clock
-
- SC->PCONP |=0x00040000; // bit 18 of PCONP set to 1
- SC->PCLKSEL1 |=0x00000001; /* bits 1,0 00 CCLK/4
- 01 CCLK
- 10 CCLK/2
- 11 CCLK/8 */
-
-
-// Enable pins for QEI MCI0, MCI1 (PhA PhB, signals respectively)
-
-
- PINCON->PINSEL3 = ((PINSEL3 &=0xFFFF3DFF) |= 0x00004100); /* 01 in bits 9:8 and 15:14*/
- //PINCON->PINSEL3 = ((PINSEL3 &=0xFFFCFFFF) |= 0x00010000); /* Turns on MCI2 index input 17:16 = 01*/
-
-
-
-// Specify Quadrature phase mode
-
- // QEI->QEICON &= 0xFFFFFFFE; /* Clears position counter */
- QEI->QEICONF &= 0XFFFFFFFD; /* Sets bit 1 to 0, Signal mode to Quad Phase */
- // QEI->QEICON |= 0X00000002; /* Bit 2 to 1 counts both PhA and PhB for higher resolution */
-
-
-
- // QEI->FILTER = ****Whatever Sampling size we want*** /* Sets the number of consecutive pulses for a change in direction, etc to accepted */
-
-
-// Set Various Attributes
-
- // QEI->QEIMAXPOS = *****insert max position*****;
-
-
-/* Note: QEI->QEIPOS is a read only section that stores the current position */
\ No newline at end of file