MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / setLogBuffer

Method setLogBuffer

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:862–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862bool OLEDDisplay::setLogBuffer(uint16_t lines, uint16_t chars){
863 if (logBuffer != NULL) free(logBuffer);
864 uint16_t size = lines * chars;
865 if (size > 0) {
866 this->logBufferLine = 0; // Lines printed
867 this->logBufferFilled = 0; // Nothing stored yet
868 this->logBufferMaxLines = lines; // Lines max printable
869 this->logBufferSize = size; // Total number of characters the buffer can hold
870 this->logBuffer = (char *) malloc(size * sizeof(uint8_t));
871 if(!this->logBuffer) {
872 DEBUG_OLEDDISPLAY("[OLEDDISPLAY][setLogBuffer] Not enough memory to create log buffer\n");
873 return false;
874 }
875 }
876 return true;
877}
878
879size_t OLEDDisplay::write(uint8_t c) {
880 if (this->logBufferSize > 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected