|
From: Alain P. <apa...@us...> - 2002-08-16 14:24:24
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
btinit.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Changed the value of reset on DTR port : Reset is active high.
The diff of the modified file(s):
--- btinit.c 22 Jul 2002 17:22:13 -0000 1.22
+++ btinit.c 16 Aug 2002 14:24:22 -0000 1.23
@@ -152,25 +152,27 @@
/* Normally, the RTS should be LOW after having opened the serial port */
/* Wait 200 ms to be sure to have a valid reset */
=20
+ /* If we set the bit to 1 in the DTR register, this will result */
+ /* in a value of 0 on the port. So make &=3D to put the output to 1 */
=20=09
if (ioctl (phys_fd, TIOCMGET, &iosettings) !=3D 0) {
fprintf(stderr, "btinit : Error for ioctl TIOCMGET\n");
}
printf("Set DTR to 0\n");
- iosettings &=3D ~TIOCM_DTR;
+ iosettings |=3D TIOCM_DTR;
if (ioctl (phys_fd, TIOCMSET, &iosettings) !=3D 0) {
fprintf(stderr, "btinit : Error for ioctl TIOCMSET\n");
}
usleep(500000);=09
printf("Set DTR to 1\n");
- iosettings |=3D TIOCM_DTR;
+ iosettings &=3D ~TIOCM_DTR;
ioctl (phys_fd, TIOCMSET, &iosettings);
- //DBG ("Resetting the module");
+
usleep(200000); /*Sleep 200 ms for reset*/
printf("Set DTR to 0 again\n");
- iosettings &=3D ~TIOCM_DTR;
+ iosettings |=3D TIOCM_DTR;
ioctl (phys_fd, TIOCMSET, &iosettings);
- //DBG ("End of reset");
+
D(syslogprintf("btinit : DTR set to HIGH\n"));
sleep(2); /* Wait that module boot. 1 second is too short */
=20=09
|