File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -59,37 +59,37 @@ OLEDDisplay::~OLEDDisplay() {
59
59
60
60
bool OLEDDisplay::allocateBuffer () {
61
61
62
- logBufferSize = 0 ;
63
- logBufferFilled = 0 ;
64
- logBufferLine = 0 ;
65
- logBufferMaxLines = 0 ;
66
- logBuffer = NULL ;
62
+ logBufferSize = 0 ;
63
+ logBufferFilled = 0 ;
64
+ logBufferLine = 0 ;
65
+ logBufferMaxLines = 0 ;
66
+ logBuffer = NULL ;
67
67
68
68
if (!this ->connect ()) {
69
69
DEBUG_OLEDDISPLAY (" [OLEDDISPLAY][init] Can't establish connection to display\n " );
70
70
return false ;
71
71
}
72
72
73
73
if (this ->buffer ==NULL ) {
74
- this ->buffer = (uint8_t *) malloc ((sizeof (uint8_t ) * displayBufferSize) + getBufferOffset ());
75
- this ->buffer += getBufferOffset ();
74
+ this ->buffer = (uint8_t *) malloc ((sizeof (uint8_t ) * displayBufferSize) + getBufferOffset ());
75
+ this ->buffer += getBufferOffset ();
76
76
77
- if (!this ->buffer ) {
78
- DEBUG_OLEDDISPLAY (" [OLEDDISPLAY][init] Not enough memory to create display\n " );
79
- return false ;
80
- }
77
+ if (!this ->buffer ) {
78
+ DEBUG_OLEDDISPLAY (" [OLEDDISPLAY][init] Not enough memory to create display\n " );
79
+ return false ;
80
+ }
81
81
}
82
82
83
83
#ifdef OLEDDISPLAY_DOUBLE_BUFFER
84
84
if (this ->buffer_back ==NULL ) {
85
- this ->buffer_back = (uint8_t *) malloc ((sizeof (uint8_t ) * displayBufferSize) + getBufferOffset ());
86
- this ->buffer_back += getBufferOffset ();
87
-
88
- if (!this ->buffer_back ) {
89
- DEBUG_OLEDDISPLAY (" [OLEDDISPLAY][init] Not enough memory to create back buffer\n " );
90
- free (this ->buffer - getBufferOffset ());
91
- return false ;
92
- }
85
+ this ->buffer_back = (uint8_t *) malloc ((sizeof (uint8_t ) * displayBufferSize) + getBufferOffset ());
86
+ this ->buffer_back += getBufferOffset ();
87
+
88
+ if (!this ->buffer_back ) {
89
+ DEBUG_OLEDDISPLAY (" [OLEDDISPLAY][init] Not enough memory to create back buffer\n " );
90
+ free (this ->buffer - getBufferOffset ());
91
+ return false ;
92
+ }
93
93
}
94
94
#endif
95
95
You can’t perform that action at this time.
0 commit comments