got the sonar sensor working again
diff --git a/bbb_cape/src/bbb/sensor_reader.cc b/bbb_cape/src/bbb/sensor_reader.cc
index 86d4d8b..c6d6521 100644
--- a/bbb_cape/src/bbb/sensor_reader.cc
+++ b/bbb_cape/src/bbb/sensor_reader.cc
@@ -73,6 +73,9 @@
continue;
}
if (data->timestamp < last_cape_timestamp_) {
+ // TODO(brians): A common failure mode of the cape is to send the same 2
+ // packets (from the ring buffer) out repeatedly. Detect that and reset
+ // it.
LOG(WARNING, "cape timestamp decreased: %" PRIu64 " to %" PRIu64 "\n",
last_cape_timestamp_, data->timestamp);
ResetHappened();
diff --git a/bbb_cape/src/cape/robot_comp.c b/bbb_cape/src/cape/robot_comp.c
index c33dc36..d7d8e8e 100644
--- a/bbb_cape/src/cape/robot_comp.c
+++ b/bbb_cape/src/cape/robot_comp.c
@@ -90,14 +90,14 @@
SHOOTER(7, 5, 4, 8, 0)
// TIM11.1 on PB9, aka digital input 6.
-timer_declare(TIM11, TIM1_TR_GCOM_TIM11_IRQHandler, 1, 1, ultrasonic)
+timer_declare(TIM11, TIM1_TRG_COM_TIM11_IRQHandler, 1, 1, ultrasonic)
void robot_init(void) {
gpio_setup_alt(GPIOB, 9, 3);
RCC->APB2ENR |= RCC_APB2ENR_TIM11EN;
TIM11->CCMR1 = TIM_CCMR1_CC1S_0 /* input pin 1 -> timer input 1 */;
TIM11->PSC = 1200 - 1; // 100KHz timer
- //timer_setup(TIM11, TIM1_TRG_COM_TIM11_IRQn, 1);
+ timer_setup(TIM11, TIM1_TRG_COM_TIM11_IRQn, 1);
}
void robot_fill_packet(struct DataStruct *packet) {