-
-
Save fregmented/6cdb185a2fad3e4597973e2fdaa53099 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char *argv[]) { | |
// BLAHBLAH | |
UART_eSetRTS(iUartFd, 1); // nRESET | |
UART_eSetDTR(iUartFd, 1); // nPROG | |
struct timespec ts; | |
ts.tv_sec = 0; | |
ts.tv_nsec = 100000000; // 100 ms | |
nanosleep(&ts, NULL); | |
UART_eSetRTS(iUartFd, 0); // nRESET | |
ts.tv_sec = 0; | |
ts.tv_nsec = 100000000; // 100 ms | |
nanosleep(&ts, NULL); | |
UART_eSetDTR(iUartFd, 0); // nPROG | |
if (iInitialSpeed != iProgramSpeed) | |
{ | |
if (iVerbosity > 1) | |
{ | |
printf("Setting baudrate: %d\n", iProgramSpeed); | |
} | |
/* Talking at initial speed - change bootloader to programming speed */ | |
if (BL_eSetBaudrate(iUartFd, iProgramSpeed) != E_STATUS_OK) | |
{ | |
printf("Error setting baudrate\n"); | |
return -1; | |
} | |
} | |
// BLAHBLAH | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment