made the code run again on the robot by disabling the ultrasonic sensor
diff --git a/bbb_cape/src/cape/robot_comp.c b/bbb_cape/src/cape/robot_comp.c
index 03e529a..c33dc36 100644
--- a/bbb_cape/src/cape/robot_comp.c
+++ b/bbb_cape/src/cape/robot_comp.c
@@ -97,7 +97,7 @@
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) {
diff --git a/bbb_cape/src/cape/timer.h b/bbb_cape/src/cape/timer.h
index a356de1..0cca0de 100644
--- a/bbb_cape/src/cape/timer.h
+++ b/bbb_cape/src/cape/timer.h
@@ -5,7 +5,7 @@
// inverted is 1 for timing low periods, 0 for high ones.
#define timer_declare(timer, irq, input, inverted, name) \
- static volatile uint32_t name##_length; \
+ static volatile uint32_t name##_length = 0; \
void irq(void) { \
timer->SR = ~TIM_SR_CC##input##IF; \
const uint32_t ccer = timer->CCER; \