|
@@ -68,6 +68,8 @@ struct lpc_device *lpc_setup(struct serial_device *port) {
|
|
|
|
|
|
void lpc_init(struct lpc_device *dev) {
|
|
|
char buf[4096];
|
|
|
+
|
|
|
+ serial_read(dev->port, buf, sizeof(buf), 0);
|
|
|
|
|
|
serial_write(dev->port, "?");
|
|
|
|
|
@@ -293,7 +295,10 @@ int lpc_await_reply(struct lpc_device *dev, ...) {
|
|
|
int lpc_getline(struct lpc_device *dev, char *buf) {
|
|
|
if(sprog_waitdata(dev->port, dev->reply_time)==0)
|
|
|
return 0;
|
|
|
+// sprog_info("fgets...\n");
|
|
|
fgets(buf, 4096, dev->port->f);
|
|
|
+// sprog_info("...fgets\n");
|
|
|
+// sprog_info("--> %s\n", buf);
|
|
|
return 1;
|
|
|
}
|
|
|
|