diff options
author | norly <ny-git@enpas.org> | 2019-02-19 22:55:18 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2019-02-19 22:55:18 +0100 |
commit | 598aacbfeb201ea7f2ceb404952369d544b615c9 (patch) | |
tree | f1b2ce9da3483b4af180502c3660e2fd7d030219 | |
parent | 183c77ad6d6a64a7715a5e95fd8e68986019c3b2 (diff) |
Simplify init script sending
My problems with initializing the chip should now be solved by the
'accept_flaky_uart' module parameter.
-rw-r--r-- | module/elmcan.c | 12 |
1 files changed, 2 insertions, 10 deletions
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))); |