projects
/
elmcan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
54b669c
)
Replace '>' with constant ELM327_READY_CHAR
author
norly
<ny-git@enpas.org>
Wed, 23 Jan 2019 15:19:18 +0000
(16:19 +0100)
committer
norly
<ny-git@enpas.org>
Wed, 23 Jan 2019 15:19:18 +0000
(16:19 +0100)
module/elmcan.c
patch
|
blob
|
history
readme.rst
patch
|
blob
|
history
diff --git
a/module/elmcan.c
b/module/elmcan.c
index 494dceb445f885b1020ce183e41d3c8febb30ac2..e4552024d3ae3015657133f74fc87e0fba5eefe7 100644
(file)
--- a/
module/elmcan.c
+++ b/
module/elmcan.c
@@
-57,6
+57,7
@@
MODULE_AUTHOR("Max Staudt <max-linux@enpas.org>");
#define ELM327_MAGIC_CHAR 'y'
#define ELM327_MAGIC_STRING "y"
#define ELM327_MAGIC_CHAR 'y'
#define ELM327_MAGIC_STRING "y"
+#define ELM327_READY_CHAR '>'
/* Bits in elm->cmds_todo */
/* Bits in elm->cmds_todo */
@@
-623,7
+624,7
@@
static void elm327_parse_rxbuf(struct elmcan *elm)
elm->state = ELM_GETPROMPT;
i++;
break;
elm->state = ELM_GETPROMPT;
i++;
break;
- } else if (elm->rxbuf[i] ==
'>'
) {
+ } else if (elm->rxbuf[i] ==
ELM327_READY_CHAR
) {
elm327_send(elm, ELM327_MAGIC_STRING, 1);
i++;
break;
elm327_send(elm, ELM327_MAGIC_STRING, 1);
i++;
break;
@@
-637,7
+638,7
@@
static void elm327_parse_rxbuf(struct elmcan *elm)
case ELM_GETPROMPT:
/* Wait for '>' */
case ELM_GETPROMPT:
/* Wait for '>' */
- if (elm->rxbuf[elm->rxfill - 1] ==
'>'
) {
+ if (elm->rxbuf[elm->rxfill - 1] ==
ELM327_READY_CHAR
) {
elm327_handle_prompt(elm);
}
elm327_handle_prompt(elm);
}
@@
-660,7
+661,7
@@
static void elm327_parse_rxbuf(struct elmcan *elm)
elm327_panic(elm);
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
elm327_panic(elm);
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
- && elm->rxbuf[elm->rxfill - 1] ==
'>'
) {
+ && elm->rxbuf[elm->rxfill - 1] ==
ELM327_READY_CHAR
) {
/* The ELM327's AT ST response timeout ran out,
* so we got a prompt.
* Clear RX buffer and restart listening.
/* The ELM327's AT ST response timeout ran out,
* so we got a prompt.
* Clear RX buffer and restart listening.
diff --git
a/readme.rst
b/readme.rst
index 2ff9fe4b4f4d9a51675dbb855815d1bb4853cd7e..45c5c6cc627fed5328b4cab777ccb83388f11ad1 100644
(file)
--- a/
readme.rst
+++ b/
readme.rst
@@
-270,6
+270,4
@@
To Do list for future development
- DMA capable rx/tx buffers
- DMA capable rx/tx buffers
-- fixup constants, constant for '``>``'
-
- flushing of ``tx_work`` is too late in ``ldisc_close()``
- flushing of ``tx_work`` is too late in ``ldisc_close()``