Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification to make fast loader work on Raspberry Pi serial port. Te… #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ static BoardConfig *GetDefaultConfiguration(void)
defaultConfig = NewBoardConfig(NULL, DEF_BOARD);
SetConfigField(defaultConfig, "baudrate", "115200");
SetConfigField(defaultConfig, "loader-baud-rate", "115200");
#ifdef RASPBERRY_PI
SetConfigField(defaultConfig, "fast-loader-baud-rate", "1000000");
#else
SetConfigField(defaultConfig, "fast-loader-baud-rate", "921600");
#endif
SetConfigField(defaultConfig, "rxpin", "31");
SetConfigField(defaultConfig, "txpin", "30");
SetConfigField(defaultConfig, "sdspi-do", "22");
Expand Down
4 changes: 2 additions & 2 deletions src/serial_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int OpenSerial(const char *port, int baud, SERIAL **pSerial)
sparams = serial->oldParams;

/* set raw input */
#ifdef MACOSX
#if defined(MACOSX) || defined(RASPBERRY_PI)
cfmakeraw(&sparams);
sparams.c_cc[VTIME] = 0;
sparams.c_cc[VMIN] = 1;
Expand Down Expand Up @@ -305,7 +305,7 @@ int SetSerialBaud(SERIAL *serial, int baud)
chk("tcgetattr", tcgetattr(serial->fd, &sparams));

/* set raw input */
#ifdef MACOSX
#if defined(MACOSX) || defined(RASPBERRY_PI)
chk("cfsetspeed", cfsetspeed(&sparams, tbaud));
#else
chk("cfsetispeed", cfsetispeed(&sparams, tbaud));
Expand Down