mit-drl / e-vent

MIT Project: A low cost emergency ventilator controller
39 stars 31 forks source link

Display.cpp wirteBPM method #66

Closed srinivasboppu closed 4 years ago

srinivasboppu commented 4 years ago

void Display::writeBPM(const int& bpm) { const int bpm_c = constrain(bpm, 0, 99); char buff[12]; sprintf(buff, "%2s=%2s ", getLabel(BPM).c_str(), toString(VOLUME, bpm_c).cstr()); write(elements[BPM].row, elements_[BPM].col, buff); }

here, the sprintf line is wrong, it should be:

sprintf(buff, "%2s=%2s ", getLabel(BPM).c_str(), toString(BPM, bpm_c).c_str());

amadoantonini commented 4 years ago

Thanks for the catch! The behavior is still correct because toString(VOLUME, bpm_c) and toString(BPM, bpm_c) do the same thing. But I've fixed it in #67.

teddyort commented 4 years ago

Fixed in https://github.com/mit-drl/e-vent/pull/67. Closing.