From: norly Date: Tue, 19 Feb 2019 21:55:18 +0000 (+0100) Subject: Simplify init script sending X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=598aacbfeb201ea7f2ceb404952369d544b615c9;p=elmcan.git Simplify init script sending My problems with initializing the chip should now be solved by the 'accept_flaky_uart' module parameter. --- diff --git a/module/elmcan.c b/module/elmcan.c index 538134c..8864196 100644 --- a/module/elmcan.c +++ b/module/elmcan.c @@ -618,22 +618,14 @@ static void elm327_handle_prompt(struct elmcan *elm) /* Reconfigure ELM327 step by step as indicated by elm->cmds_todo */ if (test_bit(ELM_TODO_INIT, &elm->cmds_todo)) { - elm327_send(elm, *elm->next_init_cmd, strlen(*elm->next_init_cmd)); + strcpy(local_txbuf, *elm->next_init_cmd); + elm->next_init_cmd++; if (!(*elm->next_init_cmd)) { clear_bit(ELM_TODO_INIT, &elm->cmds_todo); netdev_info(elm->dev, "Initialization finished.\n"); } - /* Some chips are unreliable and need extra time after - * init commands, as seen with a clone. - * So let's do a dummy get-cmd-prompt dance. - */ - elm->state = ELM_NOTINIT; - elm327_kick_into_cmd_mode(elm); - - return; - } else if (test_and_clear_bit(ELM_TODO_SILENT_MONITOR, &elm->cmds_todo)) { sprintf(local_txbuf, "ATCSM%i\r", !(!(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)));