[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FBUS speed change to 19200 and 115200
From: |
Jari Turkia |
Subject: |
Re: FBUS speed change to 19200 and 115200 |
Date: |
Wed, 21 Nov 2007 23:58:08 +0200 |
User-agent: |
Thunderbird 2.0.0.9 (Windows/20071031) |
Pawel Kot wrote:
First you need to increase the sleep into 50000 usecs. The command
simply does not sink in very fast.
That should not matter. You would just loop more times with 50.
It absolutely matters and no, it will not iterate more. It will just
delay more.
[fbus.c]
static int send_command(char *cmd, int len, struct gn_statemachi
...
while (res > 0 && waitformore) {
/* Avoid 'device temporarily unavailable' error */
usleep(50);
...
50 usecs is not enough for 6610i. 1000 times more will do the job. I
added debug output of the buffer and it was always empty until there was
properly time for the command to sink in.
Secondly you cannot free the device instance on FBUS terminate-command.
Sorry, I don't get it.
Ok. I'll elaborate.
[nk6510.c]
static gn_error NK6510_Initialise(struct gn_statemachine *state)
...
while (!connected) {
if (attempt > 2) break;
...
err = state->driver.functions(GN_OP_GetModel, &data, state);
if (err != GN_ERR_NONE) {
/* ignore return value from GN_OP_Terminate, will use pr
state->driver.functions(GN_OP_Terminate, &data, state);
} else {
...
So, you'll get three rounds of initialization. In my case the first one
fails. Then terminate is called. As terminate releases device instance:
case GN_OP_Terminate:
FREE(DRVINSTANCE(state));
There will not be a working device handle left for the two other rounds.
In my case, the third round will do the trick.
Hope this explanation helps.
Regards,
Jari Turkia
- FBUS speed change to 19200 and 115200, Jari Turkia, 2007/11/07
- Re: FBUS speed change to 19200 and 115200, Pawel Kot, 2007/11/07
- Re: FBUS speed change to 19200 and 115200, Jari Turkia, 2007/11/08
- Re: FBUS speed change to 19200 and 115200, Pawel Kot, 2007/11/08
- Re: FBUS speed change to 19200 and 115200, Jari Turkia, 2007/11/21
- Re: FBUS speed change to 19200 and 115200, Pawel Kot, 2007/11/21
- Re: FBUS speed change to 19200 and 115200,
Jari Turkia <=
- Re: FBUS speed change to 19200 and 115200, Pawel Kot, 2007/11/21
- Re: FBUS speed change to 19200 and 115200, Jari Turkia, 2007/11/22