Skip to content

Commit 7edc88e

Browse files
committed
put that back
1 parent fa66e4b commit 7edc88e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

board/drivers/canbitbang.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ void bitbang_gmlan(CAN_FIFOMailBox_TypeDef *to_bang) {
125125
silent_count = 0;
126126
}
127127
int lwait = TIM2->CNT;
128-
while ((TIM2->CNT - lwait) < SPEEED);
128+
while (get_ts_elapsed(TIM2->CNT, lwait) < SPEEED);
129129
}
130130

131131
// send my message with optional failure
132132
int last = 1;
133133
int init = TIM2->CNT;
134134
for (int i = 0; i < len; i++) {
135-
while ((TIM2->CNT - init) < (SPEEED*i));
135+
while (get_ts_elapsed(TIM2->CNT, init) < (SPEEED*i));
136136
int read = get_gpio_input(GPIOB, 12);
137137
if ((read == 0 && last == 1) && i != (len-11)) {
138138
puts("ERR: bus driven at ");

0 commit comments

Comments
 (0)