diff -r 8f2be7aaec00 -r 424d792fea4f src/hp34comm.cpp --- a/src/hp34comm.cpp Thu Oct 15 01:12:31 2020 +0200 +++ b/src/hp34comm.cpp Fri Oct 16 22:08:47 2020 +0200 @@ -1,6 +1,7 @@ #include "hp34comm.h" -#include "mbed.h" -#include "CircularBuffer.h" + +#include +#include /***** HP 34970A communication class ***/ @@ -37,7 +38,7 @@ { serial.baud(187500); cur_state = STATE_IDLE; - serial.attach(callback(this, &HPSerial::rxIrq), Serial::RxIrq); + serial.attach(callback(this, &HPSerial::rxIrq), SerialBase::RxIrq); } void HPSerial::startup(void) { @@ -105,7 +106,7 @@ } void HPSerial::send_ack(uint8_t c) { - serial.putc(c); + serial.write(&c, 1); set_timer(RXTIMEOUT); // if nothing else happen in the next ms, reset } @@ -184,14 +185,14 @@ { return do_state_eot(); } - serial.putc(tr_data.payload[tr_data.pos++]); + serial.write(&tr_data.payload[tr_data.pos++], 1); set_timer(RXTIMEOUT); return HPSerial::STATE_SENDING; } HPSerial::state_t HPSerial::do_state_eot(uint8_t c) { - serial.putc(0x55); // EoT + serial.write(&c, 1); // EoT cur_gstate = GSTATE_IDLE; set_timer(); // We are IDLE, detach the timeouter return STATE_IDLE; @@ -212,7 +213,8 @@ inrx=1; #endif //lled = 1; - val = serial.getc(); + //val = serial.getc(); + serial.read(&val, 1); cur_state = run_state(cur_state, val); //lled = 0; #ifdef DEBUG2