Skip to content

Commit 80051be

Browse files
committed
autoretry on chime
1 parent 813218d commit 80051be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

board/drivers/canbitbang.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,14 @@ void TIM4_IRQHandler(void) {
137137
puts("ERR: bus driven at ");
138138
puth(gmlan_sending);
139139
puts("\n");
140-
gmlan_sendmax = -1; // exit
140+
// reset sender (retry after 7 silent)
141+
gmlan_silent_count = 0;
142+
gmlan_sending = 0;
141143
} else {
142144
set_bitbanged_gmlan(pkt_stuffed[gmlan_sending]);
143145
gmlan_sending++;
144146
}
145-
if (gmlan_sending == gmlan_sendmax || gmlan_sendmax == -1) {
147+
if (gmlan_sending == gmlan_sendmax) {
146148
set_bitbanged_gmlan(1); // recessive
147149
set_gpio_mode(GPIOB, 13, MODE_INPUT);
148150
TIM4->DIER = 0; // no update interrupt

0 commit comments

Comments
 (0)