mirror of
https://github.com/dschmenk/apple2pi.git
synced 2024-11-24 12:31:30 +00:00
Only set GPCLK on default Pi serial port. Force 115.2 Kbaud
This commit is contained in:
parent
13bd130756
commit
32598a68c6
14
src/a2pid.c
14
src/a2pid.c
@ -17,6 +17,7 @@
|
|||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/uinput.h>
|
#include <linux/uinput.h>
|
||||||
|
|
||||||
|
char deftty[] = "/dev/ttyAMA0"; /* Default for Raspberry Pi */
|
||||||
#if defined(SETSERCLK) && defined(__ARMEL__)
|
#if defined(SETSERCLK) && defined(__ARMEL__)
|
||||||
#include "gpclk.c"
|
#include "gpclk.c"
|
||||||
#endif
|
#endif
|
||||||
@ -301,7 +302,7 @@ void sendrelxy(int fd, int x, int y)
|
|||||||
write(fd, &evsync, sizeof(evsync));
|
write(fd, &evsync, sizeof(evsync));
|
||||||
}
|
}
|
||||||
/*****************************************************************\
|
/*****************************************************************\
|
||||||
* *
|
* *
|
||||||
* Request queue management *
|
* Request queue management *
|
||||||
* *
|
* *
|
||||||
\*****************************************************************/
|
\*****************************************************************/
|
||||||
@ -454,7 +455,7 @@ void main(int argc, char **argv)
|
|||||||
int a2fd, kbdfd, moufd, srvfd, maxfd;
|
int a2fd, kbdfd, moufd, srvfd, maxfd;
|
||||||
struct sockaddr_in servaddr;
|
struct sockaddr_in servaddr;
|
||||||
fd_set readset, openset;
|
fd_set readset, openset;
|
||||||
char *devtty = "/dev/ttyAMA0"; /* default for Raspberry Pi */
|
char *devtty = deftty;
|
||||||
char *vdrvdir = "/usr/share/a2pi/"; /* default vdrv image directory */
|
char *vdrvdir = "/usr/share/a2pi/"; /* default vdrv image directory */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -586,8 +587,11 @@ void main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Initialize ACIA clock for Apple II Pi card
|
* Initialize ACIA clock for Apple II Pi card
|
||||||
*/
|
*/
|
||||||
gpclk(271); /* divisor for ~1.8 MHz => (500/271) MHz */
|
if (devtty == deftty)
|
||||||
sleep(1); /* give clock chance to settle down */
|
{
|
||||||
|
gpclk(271); /* divisor for ~1.8 MHz => (500/271) MHz */
|
||||||
|
sleep(1); /* give clock chance to settle down */
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Open serial port.
|
* Open serial port.
|
||||||
@ -605,6 +609,8 @@ void main(int argc, char **argv)
|
|||||||
newtio.c_lflag = 0; /* set input mode (non-canonical, no echo,...) */
|
newtio.c_lflag = 0; /* set input mode (non-canonical, no echo,...) */
|
||||||
newtio.c_cc[VTIME] = 0; /* inter-character timer unused */
|
newtio.c_cc[VTIME] = 0; /* inter-character timer unused */
|
||||||
newtio.c_cc[VMIN] = 1; /* blocking read until 1 char received */
|
newtio.c_cc[VMIN] = 1; /* blocking read until 1 char received */
|
||||||
|
cfsetispeed(&newtio, B115200);
|
||||||
|
cfsetospeed(&newtio, B115200);
|
||||||
tcsetattr(a2fd, TCSANOW, &newtio);
|
tcsetattr(a2fd, TCSANOW, &newtio);
|
||||||
prlog("a2pid: Waiting to connect to Apple II...\n");
|
prlog("a2pid: Waiting to connect to Apple II...\n");
|
||||||
iopkt[0] = 0x80; /* request re-sync if Apple II already running */
|
iopkt[0] = 0x80; /* request re-sync if Apple II already running */
|
||||||
|
Loading…
Reference in New Issue
Block a user