Compare commits

..

2 commits

Author SHA1 Message Date
Gered e4ea3dd431 re-enable uart channel device driver installation
i'm not really sure why this was commented out to begin with. possibly
due to the broken parsing of the channel path string in uart_open, but
i am unsure exactly.
2025-02-03 20:57:30 -05:00
Gered 51634ffd6b fix uart_open's incorrect use of strtok_r, fixing uart device init 2025-02-03 20:53:39 -05:00
2 changed files with 8 additions and 8 deletions

View file

@ -293,7 +293,7 @@ short uart_open(p_channel chan, const unsigned char * spec, short mode) {
uart_setbps(cdev_to_uart(chan->dev), bps_code);
// Get the next token
token = strtok_r(spec_copy, ",", &saveptr);
token = strtok_r(NULL, ",", &saveptr);
if (token) {
// Parse the data bit count
i = atoi(token);
@ -320,7 +320,7 @@ short uart_open(p_channel chan, const unsigned char * spec, short mode) {
}
// Get the next token
token = strtok_r(spec_copy, ",", &saveptr);
token = strtok_r(NULL, ",", &saveptr);
if (token) {
// Parse the stop bit count (1 or 2)
i = atoi(token);
@ -334,7 +334,7 @@ short uart_open(p_channel chan, const unsigned char * spec, short mode) {
}
// Get the next token
token = strtok_r(spec_copy, ",", &saveptr);
token = strtok_r(NULL, ",", &saveptr);
if (token) {
// NONE, ODD, EVEN, MARK, or SPACE
if (strcmp(token, "NONE") == 0) {

View file

@ -246,11 +246,11 @@ void initialize() {
}
#endif
// if (res = uart_install()) {
// log_num(LOG_ERROR, "FAILED: serial port initialization", res);
// } else {
// log(LOG_INFO, "Serial ports initialized.");
// }
if ((res = uart_install())) {
log_num(LOG_ERROR, "FAILED: serial port initialization", res);
} else {
log(LOG_INFO, "Serial ports initialized.");
}
if ((res = fsys_init())) {
log_num(LOG_ERROR, "FAILED: file system initialization", res);