Commit b0ec33ff by Enrico Pozzobon

faster uart on esp32

parent d9156e69
...@@ -51,7 +51,7 @@ void my_assert(bool b) { ...@@ -51,7 +51,7 @@ void my_assert(bool b) {
} }
void setup() { void setup() {
SerialOut.begin(115200); SerialOut.begin(500000);
pinMode(CRYPTO_BUSY, OUTPUT); pinMode(CRYPTO_BUSY, OUTPUT);
digitalWrite(CRYPTO_BUSY, HIGH); digitalWrite(CRYPTO_BUSY, HIGH);
delay(100); delay(100);
......
...@@ -36,16 +36,15 @@ void uartp_send(const void *src, uint16_t len) { ...@@ -36,16 +36,15 @@ void uartp_send(const void *src, uint16_t len) {
uint16_t uartp_recv(void *dst, uint16_t buf_len) { uint16_t uartp_recv(void *dst, uint16_t buf_len) {
uint8_t *buf = (uint8_t *) dst; uint8_t *buf = (uint8_t *) dst;
uint8_t tag_old, tag, info, cs; uint8_t tag, info, cs;
uint16_t len; uint16_t len;
tag = AMUX_END; tag = AMUX_END;
while (1) { while (1) {
do { do {
tag_old = tag;
tag = uart_rbyte(); tag = uart_rbyte();
} while(tag != AMUX_TAG || tag_old != AMUX_END); } while(tag != AMUX_TAG);
len = (uint16_t) uart_rbyte(); len = (uint16_t) uart_rbyte();
if (len & AMUX_EXT) { if (len & AMUX_EXT) {
......
...@@ -115,7 +115,7 @@ def main(argv): ...@@ -115,7 +115,7 @@ def main(argv):
eprint("Flashed") eprint("Flashed")
time.sleep(0.1) time.sleep(0.1)
ser = serial.Serial(dev, baudrate=115200, timeout=5) ser = serial.Serial(dev, baudrate=500000, timeout=5)
uartp = UARTP(ser) uartp = UARTP(ser)
ser.setDTR(False) # IO0=HIGH ser.setDTR(False) # IO0=HIGH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment