We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa66e4b commit 7edc88eCopy full SHA for 7edc88e
board/drivers/canbitbang.h
@@ -125,14 +125,14 @@ void bitbang_gmlan(CAN_FIFOMailBox_TypeDef *to_bang) {
125
silent_count = 0;
126
}
127
int lwait = TIM2->CNT;
128
- while ((TIM2->CNT - lwait) < SPEEED);
+ while (get_ts_elapsed(TIM2->CNT, lwait) < SPEEED);
129
130
131
// send my message with optional failure
132
int last = 1;
133
int init = TIM2->CNT;
134
for (int i = 0; i < len; i++) {
135
- while ((TIM2->CNT - init) < (SPEEED*i));
+ while (get_ts_elapsed(TIM2->CNT, init) < (SPEEED*i));
136
int read = get_gpio_input(GPIOB, 12);
137
if ((read == 0 && last == 1) && i != (len-11)) {
138
puts("ERR: bus driven at ");
0 commit comments